Kotlin MCQ
Test your Kotlin knowledge with 100 multiple choice questions covering fundamentals to advanced concepts, with instant feedback and explanations.
Which company developed the Kotlin programming language?
2How do you declare an immutable variable in Kotlin?
3What is the Kotlin keyword for declaring a nullable type?
4What does the Elvis operator ?: do?
5What is a data class in Kotlin?
6How do you define a function in Kotlin?
7What is a Kotlin object declaration?
8What does the safe call operator ?. do?
9What is a companion object in Kotlin?
10What is a sealed class in Kotlin?
11How do you declare a primary constructor in Kotlin?
12What is string interpolation in Kotlin?
13What is the difference between == and === in Kotlin?
14Which keyword is used for type casting in Kotlin?
15What is a lambda expression in Kotlin?
16What does the when expression replace in Kotlin?
17What is the Unit type in Kotlin?
18How do you declare an interface in Kotlin?
19What is an extension function in Kotlin?
20What does the !! (not-null assertion) operator do?
21What is the Kotlin equivalent of Java's static methods?
22What is the difference between List and MutableList in Kotlin?
23What does the init block do in a Kotlin class?
24How do you declare default parameter values in Kotlin?
25What is a Kotlin enum class?
26What is the purpose of the open keyword in Kotlin?
27What does the let scope function do?
28What does the apply scope function return?
29What is a higher-order function?
30Which collection function transforms each element to a new value?
31How does Kotlin handle null safety compared to Java?
32What is a property in Kotlin?
33What does @JvmStatic do on a companion object function?
34What is the Nothing type in Kotlin?
35How does Kotlin smart cast work?
36What is the Kotlin Range operator ..?
37What is the difference between var and val?
38How do you iterate over a list in Kotlin?
39What does the also scope function do?
40What is the use of the @Suppress annotation?
41What is a Pair in Kotlin?
What is a Kotlin coroutine?
2What is the difference between suspend fun and a regular fun?
3What is the difference between launch and async coroutine builders?
4What does the inline keyword do for a higher-order function?
5What is the purpose of reified type parameters?
6What is delegation in Kotlin using the by keyword?
7What is the lazy property delegate?
8What does withContext(Dispatchers.IO) do in a coroutine?
9What is a Flow in Kotlin coroutines?
10What is the difference between StateFlow and SharedFlow?
11What does structured concurrency mean in Kotlin?
12What is the purpose of the operator keyword?
13What is a destructuring declaration?
14What does crossinline do in an inline function?
15What is the difference between object and class in Kotlin?
16How does Kotlin's type inference work?
17What is a type alias in Kotlin?
18What is a value class (inline class) in Kotlin?
19What does the contract block in Kotlin allow?
20What is vararg in Kotlin?
21What is the spread operator * used for with vararg?
22How do you handle exceptions in Kotlin?
23What does the run scope function return?
24What is the purpose of SupervisorJob in coroutines?
25What is channel in Kotlin coroutines?
26How does Kotlin support multiple interface implementation?
27What is the difference between Dispatchers.Main and Dispatchers.IO?
28What is kotlinx.coroutines.flow.catch operator used for?
29What is the combine Flow operator?
30What is the difference between flatMapConcat and flatMapMerge?
31What does the Kotlin by lazy(LazyThreadSafetyMode.NONE) do?
32What is Kotlin's type-safe builder pattern?
33What is the with scope function?
34What is the difference between coroutineScope and supervisorScope?
35What is the purpose of Kotlin's @Volatile annotation?
36What is Kotlin's @Synchronized annotation?
37What is the difference between Kotlin's List and Array?
38What is Kotlin's buildString function?
39What is the Kotlin Coroutines CoroutineExceptionHandler?
40What are Kotlin value classes used for instead of type aliases?
How does Kotlin implement coroutine suspension internally?
2What is the Continuation Passing Style (CPS) transformation?
3What is the difference between cold and hot Flows?
4What does noinline do in an inline function parameter?
5How does Kotlin enforce null-safety at the JVM bytecode level?
6What is the purpose of Kotlin's arrow (->) in a function type?
7What is Kotlin Multiplatform (KMP) and what does it share?
8What are expect and actual declarations in KMP?
9How does Kotlin's coroutine Scope cancellation propagate?
10What is the Mutex in Kotlin coroutines and how does it differ from synchronized?
11What is Kotlin's tail-recursive optimization (tailrec)?
12What is Kotlin's multiplatform expect/actual mechanism at the compiler level?
13What is IR (Intermediate Representation) in the Kotlin compiler?
14How does Kotlin's type projection work with in/out variance?
15What is Kotlin Symbol Processing (KSP)?
16What are Kotlin context receivers and their design intent?
17What is the Kotlin compiler plugin system?
18What is Kotlin/Native and how does it differ from Kotlin/JVM?
19What is the Kotlin coroutine's low-level Continuation API?