Timers → pending callbacks → idle/prepare → poll (I/O) → check (setImmediate) → close callbacks. Between phases, microtasks run. Understanding this helps explain ordering of setImmediate vs setTimeout(fn,0) and why heavy sync work starves I/O.
Having a tech or coding interview? Check 29 JavaScript & Node.js interview questions.
Source: Node.js docs — Event loop