CodeZettaInterview Hub

Node.js · Event Loop · Fresh / Intern · Concept

Describe the Node.js event loop phases at a high level.

Short Interview Answer

Timers → pending callbacks → idle/prepare → poll → check → close callbacks, with process.nextTick and microtasks between.

Detailed Explanation

I/O callbacks mostly run in poll; `setImmediate` in check; `setTimeout` in timers. Microtasks (promises) and nextTick queues drain between phases and can starve I/O if abused. Interview depth often hinges on ordering, not memorizing every internal name.

Interview Tip

Sketch phases and place setTimeout, setImmediate, Promise.then, and nextTick.

Did you know this answer?