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

How do Python's `async`/`await` coroutines conceptually relate to Kotlin's coroutine model?

Questions in this quiz
  1. How do Python's `async`/`await` coroutines conceptually relate to Kotlin's coroutine model?
  2. What is a Kotlin coroutine "builder" like `launch` or `async`, and how do they differ from each other?
  3. What does coroutine "cancellation" mean, and why is cooperative cancellation an important concept?
  4. What does it mean that coroutine-based concurrency is "cooperative" rather than "preemptive," as OS thread scheduling typically is?
  5. 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?
  6. Why might using `GlobalScope.launch` (launching a coroutine outside any structured, lifecycle-tied scope) be generally discouraged in application code?
  7. 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?
  8. What is a coroutine, in the general sense used across languages like Kotlin, Python, and others?
  9. What is a "coroutine context" in Kotlin, and what kind of information does it typically carry?
  10. What is a common real-world use case where coroutines are particularly valuable on Android specifically?
  11. What is a common problem coroutines solve compared to using deeply nested callbacks for asynchronous code ("callback hell")?
  12. What is `withContext` used for in Kotlin coroutines, e.g. `withContext(Dispatchers.IO) { ... }`?
Gaps to close?
Read the curated Coroutines notes — core concepts, patterns, interview prep.
Coroutines notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web