Interview practice question
CPU work in an async Python service
Backend Engineering · Concurrency · Intermediate
Your FastAPI service has an endpoint that does heavy computation, and other requests slow down while it runs. How do you fix it?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- CPU work blocks event loop.
- Use def (threadpool) for blocking work.
- ProcessPoolExecutor for CPU-heavy.
- Background job queue.
- Keep async handlers non-blocking.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.