DevBits
DevBitsAndroid Handbook
Coroutines and Flow

What is the difference between suspending and blocking?

Understand why suspending frees a thread while blocking keeps it waiting.

COR-002Foundational~45 sec

What the interviewer is testing

This question isn't really about the suspend keyword.

They're trying to find out whether you understand what should happen to a thread while your code is waiting.

Can you explain why blocking keeps a thread occupied, while suspending lets that thread continue executing other work? Do you understand that coroutines don't magically make code asynchronous or convert blocking APIs into non-blocking ones?

A strong answer focuses on resource usage and explains why suspension exists, rather than simply defining the keyword.

❌ Common mistake

If they ask you to elaborate

Waiting isn't the problem

Imagine your app starts a network request.

For most of that request, the CPU isn't busy. It's simply waiting for the server to respond.

The important question is: what should happen to the thread during that time?

Blocking keeps the thread waiting

With a blocking call, the thread can't do anything else until the operation completes.

If enough threads become blocked, your application needs more threads just to keep making progress.

Suspending lets the work wait

With a suspending call, the coroutine pauses instead of holding onto the thread.

While the request is waiting, that thread is free to execute other coroutines.

When the result arrives, the coroutine resumes and continues as if nothing happened.

Production thinking

Most Android applications spend far more time waiting for I/O than performing CPU-intensive work.

Using suspending APIs for Retrofit, Room and other asynchronous operations allows the same pool of threads to keep useful work moving instead of sitting idle waiting for responses.

Suspending doesn't make slow operations faster—it simply avoids wasting threads while those operations are waiting.

Code example

lifecycleScope.launch {
    val user = repository.loadUser()
    showUser(user)
}

If loadUser() suspends while waiting for the network, the thread is free to execute other coroutines until the response is ready.

What separates a senior answer

Key takeaways

Learn more

On this page