Explain how the event loop works in JavaScript. And what gets printed to the console if a script has, one after another, a console.log, a setTimeout with zero delay, and a Promise.resolve().then?
~4 min by voice
How to approach it
This checks whether the candidate understands JavaScript's execution model: one thread, the call stack, the role of the environment (Web APIs), the difference between macrotasks and microtasks, and whether they can use that to predict the output order confidently rather than guess.
The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.