Concurrency & Asynchronous Performance Questions

How concurrency choices change throughput, latency and resource use in server-side software. Covers sizing and choosing thread pools and executors for CPU-bound versus I/O-bound work, including bounded queues, rejection policies and work-stealing pools, event-loop behavior and what blocks it, offloading blocking calls, the GIL and process-versus-thread trade-offs, connection and worker pool limits and exhaustion under a slow dependency, lock contention and how to find it (perf, eBPF, flamegraphs), lock sharding and striping, lock convoys, spinning versus blocking and backoff, head-of-line blocking, request coalescing so concurrent callers share one fetch, scheduling pipeline stages across pools, and the coordination costs that cap parallel speedup. Focuses on the performance consequences of concurrency design rather than the correctness theory of synchronization or any one language's API. Primitives and deadlock theory, per-language concurrency APIs, async syntax and promise semantics, message-driven system design, and database isolation are covered elsewhere.

MediumTechnical
69 practiced

You are choosing a concurrency model for a new high-throughput HTTP service: an event loop per process or a thread per request. How do you decide? Think through latency, memory per connection, what happens when a handler blocks, and how failures show up in production.

MediumTechnical
67 practiced

Many concurrent requests ask for the same uncached key and your backend is being hit once per request. In Python with asyncio, implement a loader so only one fetch runs per key and everyone else waits for that result. How do you handle fetch failures, cancelled waiters, and expiry?

MediumTechnical
51 practiced

After an endpoint was moved to async Python, the service freezes under load: CPU stays low, yet one slow request seems to stall all the others. How do you find which call is blocking the event loop, and how do you fix it?

MediumTechnical
48 practiced

A Node.js API's p99 latency spikes whenever one endpoint runs a roughly 200 ms synchronous computation, and every other request waits behind it. How do you confirm the event loop is the problem, and what are your options for fixing it?

MediumTechnical
69 practiced

You are moving a synchronous Python service to asyncio, but its database driver blocks. How can you keep the event loop responsive, and what does each way out cost you?

Unlock Full Question Bank

Get access to all 9 Concurrency & Asynchronous Performance interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.