Last updated: June 26, 2026
10 of 10 questions
Backpressure is when a writable stream can’t consume data as fast as it arrives; honour the write() return value or use pipeline to pause the source.
Watch heap growth over time, capture heap snapshots and diff them to find retained objects, and inspect common culprits like caches, listeners, and closures.
Roll workers one at a time: start new instances, wait until healthy, drain and gracefully shut old ones so in-flight requests finish before exit.
Always handle the error event, remove listeners to avoid leaks, watch the max-listeners limit, and prefer async iterators for stream-like consumption.
Layer caching: in-memory for hot data, Redis for shared state, HTTP caching headers at the edge, and cache expensive computed or third-party results.
Use timeouts, retries with backoff and jitter, circuit breakers, bulkheads, and fallbacks so one failing dependency doesn’t cascade into an outage.
Structured logs, metrics, and distributed tracing — the three pillars — plus correlation IDs to follow a request across services.
For performance-critical or system-level work beyond JS’s reach — heavy computation, existing C/C++ libraries — via N-API native add-ons or WebAssembly modules.
process.nextTick callbacks run before the event loop continues (after the current operation); setImmediate runs in the check phase, after I/O callbacks.
Microservices give independent scaling and deploys but add network latency, distributed-system complexity, and operational overhead — often premature for small teams.
Upload your resume and get an instant ATS score with keyword gaps — free, no sign-up.
Node.js Interview Questions
10 questions
JavaScript Interview Questions
50 questions
Advanced JavaScript Interview Questions