← InterviewIntermediate
Async or Threads?
When would you choose async/await over threads, and when would you choose threads?
The scenario
A Python service does one 200ms database query and one 150ms upstream HTTP call per request, plus a 5ms JSON transform. It runs 4 processes with 8 threads each, and CPU sits at 12% while the queue is deep.
What it tests
- Whether the candidate classifies the work before choosing a mechanism
- Whether they understand what suspension actually does versus what blocking does
- Whether they know the cost of a blocking call inside an async runtime
Answer it out loud first. Recognising a good answer is not the same skill as producing one.