What if the event loop, DB pool or third-party API is stuck?
Practice this questionWANT TO UNDERSTAND THE CONCEPT FIRST?Learn What if the event loop, DB pool or third-party API is stuck?
Definition:
A stuck backend often means a shared resource is occupied or an operation has no effective deadline. The event loop, connection pool and external API each have different ways to become saturated. Identify which queue is growing before deciding whether to optimize work, cancel it, limit it or scale capacity.
Key points:
-
Event loop: profile CPU and move heavy work to workers or jobs.
-
DB pool: find slow queries, unclosed transactions and leaked connections.
-
External API: apply timeouts, limited safe retries and a fallback when possible.
-
Use a total request deadline so several individually bounded dependency calls cannot exceed the whole user-facing budget.
Interview point:
- Increasing a timeout or pool size can hide the symptom while worsening overload; explain the limiting resource first.
Adapted from 02_NODE_EXPRESS_HTTP.md · “What if the event loop, DB pool or third-party API is stuck?”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.