Promise reactions (microtasks) run before the next macrotask. So after synchronous code, the microtask queue is drained, then timers/IO callbacks run. Order: sync → microtasks (Promise, queueMicrotask) → macrotasks (setTimeout, setImmediate in Node in its phase).
Having a tech or coding interview? Check 29 JavaScript & Node.js interview questions.
Source: Node.js — Event loop