🔰 Beginner Level (1–20)
1. What is Kotlin?
Answer:
Kotlin is a modern, statically typed programming language developed by JetBrains. It runs on the JVM and is officially supported for Android development.
2. Why is Kotlin preferred over Java?
Answer:
Less boilerplate code
Null safety
Better readability
Interoperable with Java
Coroutines for async programming
3. Is Kotlin compiled or interpreted?
Answer:
Kotlin is compiled. It compiles to bytecode that runs on the JVM.
![]() |
| Kotlin Android developer coding in Android Studio, |
4. What are key features of Kotlin?
Answer:
Null Safety
Extension Functions
Coroutines
Data Classes
Smart Casts
5. What is null safety in Kotlin?
Answer:
Kotlin prevents NullPointerException by distinguishing nullable and non-nullable types at compile time.
6. Difference between val and var?
Answer:
val→ immutable (read-only)var→ mutable
7. What is a data class?
Answer:
A data class automatically generates:
toString()equals()hashCode()copy()
8. What is lateinit?
Answer:
Used to initialize non-null variables later, mainly for dependency injection.
9. What is lazy initialization?
Answer:
Initializes variable only when first accessed, improving performance.
10. What are extension functions?
Answer:
They allow adding new functions to existing classes without modifying them.
11. What is smart casting?
Answer:
Kotlin automatically casts variable after type checking.
12. What is when expression?
Answer:when is a replacement for switch with more powerful conditions.
13. What is a companion object?
Answer:
Used to define static members inside a class.
14. What is object keyword?
Answer:
Used to create singleton objects.
15. Difference between == and ===?
Answer:
==→ structural equality===→ referential equality
16. What is type inference?
Answer:
Kotlin automatically determines variable type at compile time.
17. What is default argument?
Answer:
Allows function parameters to have default values.
18. What is named argument?
Answer:
Arguments passed using parameter names, improving readability.
19. What is string template?
Answer:
Allows embedding variables inside strings using $.
20. What are visibility modifiers in Kotlin?
Answer:
public
private
protected
internal
⚙️ Intermediate Level (21–50)
21. What is lambda expression?
Answer:
A lambda is an anonymous function used for functional programming.
22. What is higher-order function?
Answer:
Function that takes another function as parameter or returns a function.
23. What is inline function?
Answer:
Improves performance by copying function code at call site.
24. What is sealed class?
Answer:
Restricts class inheritance to same file, used in state management.
25. Difference between sealed class and enum?
Answer:
Sealed class supports different object types, enum doesn’t.
26. What is interface in Kotlin?
Answer:
Interfaces can have abstract and default implementations.
27. What is abstract class?
Answer:
Class that cannot be instantiated and may have abstract methods.
28. What is coroutine?
Answer:
Lightweight thread used for asynchronous programming.
29. Difference between thread and coroutine?
Answer:
Coroutines are lighter, faster, and non-blocking.
30. What is suspend function?
Answer:
Function that can pause and resume execution without blocking thread.
31. What is scope function?
Answer:
Functions like let, run, apply, also, with.
32. Difference between let and apply?
Answer:let → returns lambda resultapply → returns object itself
33. What is collection framework in Kotlin?
Answer:
Provides immutable and mutable collections.
34. Difference between List and MutableList?
Answer:
List is read-only; MutableList allows modification.
35. What is map in Kotlin?
Answer:
Stores key-value pairs.
36. What is filter function?
Answer:
Returns elements matching condition.
37. What is map() function?
Answer:
Transforms each element into another form.
38. What is also function?
Answer:
Used for side effects like logging.
39. What is with function?
Answer:
Calls multiple operations on single object.
40. What is by keyword?
Answer:
Used for delegation.
41. What is delegation pattern?
Answer:
Class delegates responsibilities to another class.
42. What is enum class?
Answer:
Defines a set of constant values.
![]() |
| Kotlin vs Java comparison infographic |
43. What is destructuring declaration?
Answer:
Extracts values from objects into variables.
44. What is copy() in data class?
Answer:
Creates a new object with modified values.
45. What is backing field?
Answer:
Used to customize getter and setter logic.
46. What is init block?
Answer:
Executed when class instance is created.
47. What is exception handling in Kotlin?
Answer:
Uses try-catch-finally similar to Java.
48. Is try an expression in Kotlin?
Answer:
Yes, try returns a value.
49. What is Nothing type?
Answer:
Represents no value ever returned (used for exceptions).
50. What is Unit type?
Answer:
Equivalent to void in Java.
PART 2: Advanced & Real-World (51–100)
51. What is inline class (value class)?
Answer:
A value class wraps a single value without runtime overhead, improving performance.
52. What is reified keyword?
Answer:
Allows access to generic type at runtime in inline functions.
53. What is type erasure?
Answer:
Generic type information is removed at runtime on JVM.
54. What is covariance and contravariance?
Answer:
out→ covariance (producer)in→ contravariance (consumer)
55. What is crossinline?
Answer:
Prevents non-local returns from lambda.
56. What is noinline?
Answer:
Prevents function parameter from being inlined.
57. What is tailrec function?
Answer:
Optimizes recursive calls to avoid stack overflow.
58. What is sealed interface?
Answer:
Like sealed class but for interfaces, introduced in newer Kotlin versions.
59. What is inline property?
Answer:
Property whose getter/setter is inlined for performance.
60. What is DSL in Kotlin?
Answer:
Domain Specific Language built using Kotlin’s lambdas and receivers.
61. What is coroutine dispatcher?
Answer:
Determines which thread coroutine runs on
Examples:
Dispatchers.MainDispatchers.IODispatchers.Default
62. Difference between launch and async?
Answer:
63. What is Deferred?
Answer:
A future value returned by async coroutine.
64. What is coroutine scope?
Answer:
Controls lifecycle of coroutines.
65. What is SupervisorJob?
Answer:
Prevents child coroutine failure from cancelling siblings.
66. What is structured concurrency?
Answer:
Ensures coroutines are properly scoped and cancelled.
67. What is Flow in Kotlin?
Answer:
Cold asynchronous data stream.
68. Difference between Flow and LiveData?
Answer:
Flow is cold & coroutine-based, LiveData is lifecycle-aware.
69. What is StateFlow?
Answer:
Hot stream that always holds latest value.
70. What is SharedFlow?
Answer:
Hot stream used for events.
71. What is cold vs hot stream?
Answer:
Cold → starts on collect
Hot → runs independently
72. What is channel in Kotlin?
Answer:
Used for communication between coroutines.
73. What is backpressure?
Answer:
Handling fast producers & slow consumers.
74. What is Mutex?
Answer:
Coroutine-friendly lock for synchronization.
75. What is Atomic operation?
Answer:
Operation that executes without interruption.
76. What is Kotlin Multiplatform?
Answer:
Write shared logic for Android, iOS, Web, Desktop.
77. What is expect/actual keyword?
Answer:
Used in Kotlin Multiplatform for platform-specific code.
78. What is inline receiver lambda?
Answer:
Lambda with receiver like apply, run.
79. What is result class?
Answer:
Encapsulates success or failure of operation.
80. How Kotlin improves JVM performance?
Answer:
Inline functions
Value classes
Coroutines
Smart casting
81. Why Kotlin is official Android language?
Answer:
Because of safety, conciseness, and productivity.
82. What is MVVM architecture?
Answer:
Model-View-ViewModel separates UI and logic.
83. Role of ViewModel?
Answer:
Stores UI state and survives configuration changes.
84. What is LiveData?
Answer:
Lifecycle-aware observable data holder.
85. What is Room database?
Answer:
SQLite abstraction layer for Android.
86. Difference between suspend and blocking call?
Answer:
Suspend → non-blocking
Blocking → freezes thread
87. What is repository pattern?
Answer:
Abstracts data sources from ViewModel.
88. What is dependency injection?
Answer:
Providing dependencies externally.
![]() |
| Jetpack Compose UI architecture diagram, state management, Kotlin coroutines |
89. DI tools used with Kotlin?
Answer:
Hilt
Dagger
Koin
90. What is Hilt?
Answer:
Android-optimized DI library by Google.
91. What is Jetpack Compose?
Answer:
Modern declarative UI toolkit for Android.
92. Difference between XML and Compose?
Answer:
Compose → code-based, reactive
XML → static layouts
93. What is recomposition?
Answer:
UI redraw when state changes.
94. What is remember keyword?
Answer:
Stores state across recompositions.
95. What is snapshot state?
Answer:
Triggers recomposition when changed.
96. How to handle configuration change?
Answer:
Use ViewModel + SavedStateHandle.
97. What is ANR?
Answer:
App Not Responding due to main thread blocking.
98. How to avoid memory leaks?
Answer:
Use weak references
Cancel coroutines
Avoid static context
99. How to improve app performance?
Answer:
Offload work to IO dispatcher
Use paging
Reduce recompositions
100. Why Kotlin is future-proof?
Answer:
Multiplatform support
Jetpack Compose
Coroutines
Strong community



