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/5Score 0

What role does an `exceptionHandler` (`CoroutineExceptionHandler`) play in a coroutine hierarchy?

Questions in this quiz
  1. What role does an `exceptionHandler` (`CoroutineExceptionHandler`) play in a coroutine hierarchy?
  2. What is a `CoroutineScope`, and why does launching a coroutine typically require one?
  3. What is a coroutine, in the general sense used across languages like Kotlin, Python, and others?
  4. What is a `Dispatcher` in Kotlin coroutines, e.g. `Dispatchers.IO` or `Dispatchers.Default`?
  5. What is `withContext` used for in Kotlin coroutines, e.g. `withContext(Dispatchers.IO) { ... }`?
  6. What is "structured concurrency," a core principle behind Kotlin coroutines' design?
  7. What does it mean that coroutine-based concurrency is "cooperative" rather than "preemptive," as OS thread scheduling typically is?
  8. What does coroutine "cancellation" mean, and why is cooperative cancellation an important concept?
  9. What is a common real-world use case where coroutines are particularly valuable on Android specifically?
  10. What is a `Flow` in Kotlin coroutines, and how does it relate to a single suspend function's return value?
  11. How do Python's `async`/`await` coroutines conceptually relate to Kotlin's coroutine model?
  12. What is a realistic tradeoff to weigh when deciding whether a given piece of asynchronous logic should use coroutines/suspend functions versus a simpler callback-based or synchronous-blocking approach?
Gaps to close?
Read the curated Coroutines notes — core concepts, patterns, interview prep.
Coroutines notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web