Pergunta clássica de Node.js em processo gringo. Não decore palavra por palavra: entenda a estrutura da resposta e refaça com as suas palavras, em inglês.
process.nextTick(): runs BEFORE the Event Loop continues — a special "nextTick queue", even before microtasks.
setImmediate(): runs in the "check" phase, right AFTER I/O callbacks.
setTimeout(fn, 0): goes to the normal timers/macrotask phase.
General priority: Call Stack → process.nextTick() → Microtasks → Macrotasks.
Trap (seniors get probed on this): the order between setTimeout(fn, 0) and setImmediate() is NOT guaranteed in the main module — it depends on process startup timing. But INSIDE an I/O callback, setImmediate() ALWAYS runs first, because the check phase comes right after the I/O phase.
Ler é fácil. Falar isso em inglês, sob pressão, com alguém avaliando, é outra história. No VagaGringa esse tópico vira flashcard com repetição espaçada, cai em quiz e entra no simulado.
Treinar este tópico no app