Test your knowledge. Select answers, then submit to see your score and explanations.
1. Which keyword declares a read-only variable in Kotlin?
Kotlin Basics2. What does println() do?
Kotlin Basics3. Who created Kotlin?
Kotlin Basics4. What is the entry point of a Kotlin program?
Kotlin Basics5. Which of these is NOT a valid Kotlin data type?
Kotlin Basics6. What does the ? after a type mean in Kotlin?
Null Safety7. What does the Elvis operator ?: do?
Null Safety8. What does name?.length return when name is null?
Null Safety9. What does 1..5 create in Kotlin?
Control Flow10. Which Kotlin construct replaces switch from Java?
Control Flow11. What is a default argument in Kotlin?
Functions12. What does tailrec do in Kotlin?
Functions13. What does listOf() return?
Collections14. What does filter {} do on a collection?
Collections15. What does a data class auto-generate?
OOP16. What keyword makes a Kotlin class inheritable?
OOP17. What is a sealed class in Kotlin?
OOP18. What does it refer to in a Kotlin lambda?
Lambdas19. What does delay() do in a Kotlin coroutine?
Coroutines20. What is the difference between launch and async?
Coroutines21. What is a cold Flow in Kotlin?
Flow22. What does reified mean in a Kotlin inline function?
Generics23. What symbol is used for string templates in Kotlin?
Kotlin Basics24. What is a companion object in Kotlin?
OOP25. What does !! do in Kotlin?
Null Safety26. Which is the correct way to declare a mutable variable?
Kotlin Basics27. What does the .. operator create?
Kotlin Basics28. How do you embed a variable in a string?
Strings29. What does break do inside a for loop?
Control Flow30. What does continue do in a loop?
Control Flow31. What is a single-expression function?
Functions32. What does the inline keyword do on a function?
Functions33. What does map {} do on a list?
Collections34. What does setOf() create?
Collections35. How do you get a value from a map by key?
Collections36. What is an object declaration in Kotlin?
OOP37. What does override mean on a function?
OOP38. What is an interface in Kotlin?
OOP39. What is the type of { x: Int -> x * 2 }?
Lambdas40. What does apply return?
Scope Functions41. What does with do?
Scope Functions42. Does Kotlin have checked exceptions like Java?
Exceptions43. What does finally do in try/catch?
Exceptions44. What is type erasure?
Generics45. What is a coroutine scope?
Coroutines46. What does await() do on a Deferred?
Coroutines47. What is StateFlow used for?
Flow48. Which file extension is used for Kotlin source?
Kotlin Basics49. What is a primary constructor in Kotlin?
OOP50. What is a trailing lambda?
Lambdas51. Which dispatcher should you use for disk or network I/O?
Coroutines52. What does coroutineScope guarantee?
Coroutines53. When should you use SharedFlow instead of StateFlow?
Flow54. How do you access a companion object constant?
OOP55. What does enum class create?
OOP56. What is a top-level object declaration?
OOP