THN Interview Prep

Concurrency & async models

Core details

Compare models you can name in-room:

ModelStrengthPitfall
Thread-per-requestisolationpool exhaustion under load
Event loop / async I/Ohigh concurrency cheap waitsaccidental CPU block (sync FS, heavy regex)
Actor / mailboxordered per entitymailbox backlog unbounded if no backpressure
Worker pools + queuessmoothing burstsqueue growth if consumers slower than producers

Backpressure manifests as bounded queue depth shedding load, 429/503 with Retry-After, or slowing producers—pick intentionally with SLO alignment.

Understanding

Async shines when work is waiting-dominated (I/O). It fails when CPU-bound tasks monopolize cooperative schedulers—moving CPU work to pools/child processes preserves latency for I/O handlers. Unbounded queues pretend infinite capacity—real systems need visible saturation metrics.

Senior understanding

Demonstrate reading pool wait time and event-loop lag before blaming “the database is slow.” Mention bulkhead patterns isolating noisy neighbors (reporting vs payments). For Node specifically, cross-link /backend/nodejs/fundamentals/event-loop, but keep this page model-agnostic patterns crisp.

Diagram

Loading diagram…

See also

Spotted something unclear or wrong on this page?

On this page