Test your Coroutines knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.
Question 1/12Score 0
In Kotlin, what does the `suspend` modifier on a function indicate?
In this round
In Kotlin, what does the `suspend` modifier on a function indicate?
What does launching multiple coroutines concurrently (e.g. via `async` for several independent operations) and then awaiting all their results provide, compared to awaiting each one sequentially?
What is a common real-world use case where coroutines are particularly valuable on Android specifically?
What is the general performance/resource advantage of coroutines over spawning a large number of traditional OS threads for highly concurrent I/O-bound workloads?
What is a Kotlin coroutine "builder" like `launch` or `async`, and how do they differ from each other?
What role does an `exceptionHandler` (`CoroutineExceptionHandler`) play in a coroutine hierarchy?
What does it mean that coroutine-based concurrency is "cooperative" rather than "preemptive," as OS thread scheduling typically is?
What is the key difference between a coroutine "suspending" and a traditional thread "blocking"?
What is a `CoroutineScope`, and why does launching a coroutine typically require one?
What is `withContext` used for in Kotlin coroutines, e.g. `withContext(Dispatchers.IO) { ... }`?
How do Python's `async`/`await` coroutines conceptually relate to Kotlin's coroutine model?
What is a `Dispatcher` in Kotlin coroutines, e.g. `Dispatchers.IO` or `Dispatchers.Default`?