🐦 Kotlin
Intermediate
What are Kotlin Coroutines?
Answer
Kotlin Coroutines are a concurrency design pattern that allows you to write asynchronous, non-blocking code in a sequential, easy-to-read style. Instead of callbacks or reactive streams, you write code that looks synchronous but runs asynchronously. Coroutines are lightweight — you can run thousands of them on a single thread without the overhead of Java threads, because they do not block threads; they suspend and resume. They are integrated into the Kotlin standard library and have first-class support in Android with viewModelScope and lifecycleScope.