Skip to main content

Browser event loop · tasks and microtasks

Describe the order of synchronous code, Promise reactions, queueMicrotask and a zero-delay timer in a browser.

Official Reference

Model Answer & Explanation

The current synchronous work runs to completion. At a microtask checkpoint the browser drains the microtask queue, including newly queued microtasks, before starting the next task. Promise reactions and queueMicrotask are microtasks. Timers schedule tasks and a zero delay is not a guarantee of immediate execution.

Follow-up Interview Question · How can a long chain of microtasks delay the next timer or rendering opportunity?

Module Context & References

JavaScript · Runtime & browser theory Explain the event loop, promises, rate limiting and DOM event flow
Personal Notes · Markdown

Technologies & Interview Topics Covered

Switch between short-term interview tracks and long-term 80/20 engineering depth to practice JavaScript internals, React rendering and hooks, timed frontend machine coding UI challenges, MeetaPro FG300, Blind 75 & NeetCode 150 DSA patterns, Python & FastAPI APIs, PostgreSQL query optimization & MVCC, Redis caching, Applied AI RAG pipelines & evaluations, and distributed system design.