Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumKotlincoroutine dispatchers contextSingle-choice MCQ

Two coroutines are launched from the same scope, one with `Dispatchers.Default` and one inheriting the parent context. After a `withContext(Dispatchers.IO)` block completes inside the first coroutine, which dispatcher runs the code that follows the `withContext` block?

val scope = CoroutineScope(Dispatchers.Default) scope.launch { // coroutine A: Default withContext(Dispatchers.IO) { // runs on IO } // <-- which dispatcher here? doMoreWork() }