process.nextTick vs setImmediate
Answer out loud or in your head first, then compare.
Answer
NextTick schedules a callback to run the next time the nextTick queue is processed, before the event loop continues. SetImmediate goes to the check phase.
In practice: recursively adding nextTick callbacks can starve I/O. To yield to the event loop I pick a mechanism that fits the purpose instead of building an endless queue.
To be precise: in typical synchronous CommonJS code, nextTick runs before Promise microtasks, but at the top level of ES modules the order can differ, because the module already runs in a microtask context.
Pitfall: I don't describe the order of setTimeout(0) and setImmediate as always the same. It depends on where they're scheduled and on the environment. In a task I first establish whether it's CommonJS, ESM or an I/O callback.
How did it go? Be honest — “Not yet” puts the question on your review list.