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
52 practiced

What is head-of-line blocking? Describe where it shows up in server software (a single event loop, a shared FIFO work queue, a multiplexed connection) and how you would stop one slow request from delaying fast ones.

MediumSystem Design
93 practiced

Design the interface of a thread pool for a server that handles many short requests and occasional long-running tasks. How do tasks get submitted, how does the pool scale its workers, what are the queue and rejection policies, how does graceful shutdown work, and how do you keep long tasks from delaying short ones?

MediumTechnical
50 practiced

Build an asyncio connection pool in Python for a database driver whose calls block. It needs a hard cap on open connections, a bounded wait with a timeout when the pool is exhausted, connection reuse, and eviction of idle connections. Show the class and explain how it behaves under overload.

HardSystem Design
57 practiced

Build a Python worker system that consumes tasks from many sources with bounded queues so memory stays flat. Ordering must hold within a source while sources run in parallel. How do you reason about backpressure, fairness between sources, and recovery from worker failure?

HardTechnical
58 practiced

A Java service runs short parallel computations alongside many small asynchronous tasks, and some of those tasks occasionally block on I/O. When would you choose a work-stealing pool over a plain fixed-size executor, and what goes wrong when blocking calls land on its threads? How would you contain it?

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.