Kotlin Cheat Sheet 2026

The 30 highest-yield Kotlin facts, distilled from real exam questions. Print it, save it as a PDF, or study it here — free, no sign-up.

50 questions
60 min time limit
50.00% to pass
  1. What is the purpose of generics in Kotlin? To enable type-safe reusable code that works with different types
  2. Which keyword is used to define a constant at the top level in Kotlin? const val
  3. What will `println(10 / 3)` output in Kotlin? 3
  4. Which coroutine builder launches a new coroutine and returns a Job? launch
  5. Which Kotlin collection is immutable by default? List
  6. What does `produce` coroutine builder create? A Channel that receives values produced by a coroutine
  7. What is the difference between `List` and `MutableList` in Kotlin? List is read-only; MutableList supports add/remove operations
  8. What keyword makes a Kotlin class open for inheritance? open
  9. What does `LaunchedEffect` do in Jetpack Compose? Runs a suspend function in composition with a given key, relaunching when the key changes
  10. What is a receiver in the context of Kotlin extension functions? The object on which the extension function is called, accessible as `this`
  11. What does `for (i in 1..5)` iterate over in Kotlin? 1 to 5
  12. What is an extension property in Kotlin? A property added to an existing class without modifying its source
  13. Which function creates a Map in Kotlin from a list of pairs? both a and b are correct
  14. Which function combines all elements of a collection into a single result? fold
  15. What does the `map` function do on a Kotlin collection? Transforms each element using a given function and returns a new list
  16. What is a value class in Kotlin? A class that wraps a single value and is inlined by the compiler to avoid object overhead
  17. What is the `Nothing` type in Kotlin primarily used for? Functions that always throw or loop infinitely
  18. What does `partition` do in Kotlin? Splits a collection into two lists: matches and non-matches based on a predicate
  19. How do you check if a `lateinit var` has been initialized in Kotlin? Using `::property.isInitialized`
  20. What are the default classes in Kotlin? final
  21. Which operator is used to perform a non-null assertion in Kotlin? !!
  22. What does `!!` do in Kotlin? Non-null assertion that throws NullPointerException if null
  23. What does the `fold` function do in Kotlin? Accumulates a value starting from an initial value
  24. What does the `override` keyword do in Kotlin? Explicitly marks a method as overriding a parent class or interface member
  25. What is currying in functional programming as applied to Kotlin? Transforming a multi-argument function into a sequence of single-argument functions
  26. Which keyword is used to declare an immutable variable in Kotlin? val
  27. How do you implement an interface in Kotlin? Using `:` after the class name followed by the interface name
  28. What happens when a coroutine throws an uncaught exception? The exception propagates to the parent scope and cancels it
  29. What does the safe cast operator `as?` return when the cast is unsuccessful? null
  30. Which Kotlin keyword is equivalent to Java's `instanceof`? is
Turn these facts into recall: