All quizzes
Free quiz · 20 questions in the bank

Coroutines quiz

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
  1. In Kotlin, what does the `suspend` modifier on a function indicate?
  2. 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?
  3. What is a common real-world use case where coroutines are particularly valuable on Android specifically?
  4. 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?
  5. What is a Kotlin coroutine "builder" like `launch` or `async`, and how do they differ from each other?
  6. What role does an `exceptionHandler` (`CoroutineExceptionHandler`) play in a coroutine hierarchy?
  7. What does it mean that coroutine-based concurrency is "cooperative" rather than "preemptive," as OS thread scheduling typically is?
  8. What is the key difference between a coroutine "suspending" and a traditional thread "blocking"?
  9. What is a `CoroutineScope`, and why does launching a coroutine typically require one?
  10. What is `withContext` used for in Kotlin coroutines, e.g. `withContext(Dispatchers.IO) { ... }`?
  11. How do Python's `async`/`await` coroutines conceptually relate to Kotlin's coroutine model?
  12. What is a `Dispatcher` in Kotlin coroutines, e.g. `Dispatchers.IO` or `Dispatchers.Default`?
Gaps to close?
Read the curated Coroutines notes — core concepts, patterns, interview prep.
Coroutines notes

More quizzes

.NETAccessibilityAgileAgile MethodologyAirflowAkka