intermediate
Node runtime
How Node schedules work through V8, libuv, task queues, timers, streams, buffers, workers, and processes.
Node runtime interviews focus on how V8 and libuv schedule work through task queues, timers, streams, buffers, workers, and processes. The goal is to predict latency, memory use, and scaling behavior under real load.
Subtopics: event loop phases and microtasks, libuv basics, streams and backpressure, buffers, timers, worker threads, and cluster-based process scaling.
On interviews: draw event-loop phases, explain nextTick vs promises vs timers, and say when to move CPU work off the main thread.
Common pitfalls: recursive nextTick starving I/O, unbounded in-memory buffering on streams, and using cluster when orchestration is the better fit.
The trade-off is balancing simplicity, performance, safety, and operability — name which axis you optimized and what cost you accepted.
Checklist:
- Name phases, microtasks, and libuv thread pool roles.
- Explain streams, pipelines, and backpressure.
- Compare workers vs cluster for parallelism.
- Tie main-thread blocking to service-wide latency.