Top 3 Microtasks Interview Questions
Browse 3 real-world technical and behavioral interview questions about Microtasks. Review scenarios, edge cases, and architectural best practices.
A promise rejects and nothing is awaiting it. What does Node do?
An unhandled promise rejection in Node.js means a promise failed before any code observed the error. Treat it as a bug, await or return the promise chain, and make the process-level handler a last-resort alarm.
Walk me through the phases of the Node event loop.
Node.js event loop phases explain callback ordering across timers, poll, check, nextTick and promise microtasks. Correct answers separate macro-task phases from microtasks instead of memorising one log order.
Here is a script mixing setTimeout, a promise chain and an await. Tell me the order the logs come out in, and why.
The engine finishes the current task, then drains the whole microtask queue before taking another task, so every promise callback and await resumption runs before a zero-delay timeout, in the order each was queued. Use this event loop answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects microtasks to the point an interviewer is testing.