What does `copy(age = 31)` return here?
data class User(val name: String, val age: Int)
val a = User("Ana", 30)
val b = a.copy(age = 31)Read the full question →Every question is hand-checked, every answer comes with an explanation, and your progress builds into a clear picture of where you stand.
Every Kotlin question shows its code before you answer, so you are reading real Kotlin, not a description of it.
Once you attempt a question you get the reasoning, not just a tick. That matters most on Kotlin, where null safety and platform types, coroutine scopes and cancellation, suspend function semantics, inline and reified generics, and data class copy behaviour.
Progress is tracked per topic across the 58 Kotlin topics, so revision points at the gaps instead of the whole list.
505 Kotlin questions right now: 63 easy, 218 medium and 224 hard. That number is read straight from the question table when this page is built, so it is never a rounded marketing figure.
No. Every Kotlin question, including its code snippet, its difficulty and its topic, is readable without signing in. You need a free account only to submit an answer, see which option is correct, and read the worked explanation. We keep it that way so the platform stays honest about what you actually got right.
Null safety and platform types, coroutine scopes and cancellation, suspend function semantics, inline and reified generics, and data class copy behaviour.
58 distinct topics are tagged on the Kotlin questions, including Flow cold streams, StateFlow SharedFlow, inline functions, structured concurrency Job tree, Volatile and atomics on JVM, the Continuation interface. The topic labels come from the questions themselves, so the list matches what you will actually be asked.
Yes. Reading is free and unlimited. A free account unlocks answering, explanations and progress tracking. Pro (₹199 per month) adds AI explanations and AI-graded guesstimates on top; it is not needed to practise Kotlin MCQs.
Android apps, JVM back ends adopting Kotlin, and multiplatform mobile teams.
These are 12 of the 505 Kotlin questions in the library, pulled live from the question table. The snippet, the difficulty and the topic are all here. The answer options and the explanation are not. Those need a free account.
Null safety and platform types, coroutine scopes and cancellation, suspend function semantics, inline and reified generics, and data class copy behaviour.
data class User(val name: String, val age: Int)
val a = User("Ana", 30)
val b = a.copy(age = 31)Read the full question →val length = user?.address?.city?.lengthRead the full question →suspend fun loadData(): String = withContext(Dispatchers.IO) {
blockingDbCall()
}Read the full question →val name: String? = null
name?.let { println(it.uppercase()) }Read the full question →import kotlinx.coroutines.flow.*
import kotlinx.coroutines.runBlocking
fun main() = runBlocking {
val flow = (1..3).asFlow()
.map { println("map $it"); it * 2 }
println("flow built")
flow.collect { println("got $it") }
}Read the full question →tailrec fun isEven(n: Int): Boolean =
if (n == 0) true else isOdd(n - 1)
tailrec fun isOdd(n: Int): Boolean =
if (n == 0) false else isEven(n - 1)Read the full question →suspend fun run() = coroutineScope {
val childA = launch { delay(1000); println("A") }
val childB = launch { throw IllegalStateException("boom") }
}Read the full question →flow {
repeat(5) { emit(it); println("emitted $it") }
}.buffer(2).collect {
delay(100)
println("collected $it")
}Read the full question →import kotlinx.coroutines.*
val scope = CoroutineScope(Dispatchers.Default + CoroutineName("parent"))
fun demo() {
scope.launch(Dispatchers.IO) {
// what context applies here?
}
}Read the full question →launch {
var i = 0
while (i < 1_000_000_000) { i++ }
println("done")
}Read the full question →// Writer thread:
data = 42
flag = true
// Reader thread:
if (flag) println(data)Read the full question →tailrec fun factorial(n: Long, acc: Long = 1L): Long {
return if (n <= 1L) acc
else factorial(n - 1, acc * n)
}Read the full question →We keep the correct answer, the explanation and the scoring behind sign-in so the platform stays honest, which is why the correct option and the worked explanation for every Kotlin question stay behind a free account. Signing in is free and takes a few seconds.
Android apps, JVM back ends adopting Kotlin, and multiplatform mobile teams.