| Feature | Java Thread | Kotlin Coroutine |
|---|---|---|
| Weight | Heavyweight (OS managed) | Lightweight (User-space managed) |
| Memory | ~1MB stack per thread | ~KB per coroutine |
| Creation | Expensive | Cheap |
| Blocking | Blocks the thread when waiting | Suspends (frees thread) when waiting |
| Context Switching | OS Kernel switch (expensive) | Software switch (fast) |
| Scalability | Limited (thousands max) | Massive (millions possible) |
Key Concept: Coroutines are "computations that can be suspended". They can pause execution without blocking the underlying thread, allowing that thread to do other work.
Mark this when you can explain the answer in your own words.
Help fellow developers prepare for interviews
Sharing helps the Android community grow ๐