seniorKotlin

What is coroutine cancellation and how does it propagate?

Updated May 16, 2026

Short answer

Cancellation in coroutines is cooperative and propagates through parent-child hierarchy.

Deep explanation

When a parent coroutine is cancelled, all its child coroutines are also cancelled. Cancellation is cooperative, meaning coroutines must check for cancellation via suspension points or isActive. This ensures structured concurrency safety.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More Kotlin interview questions

View all →