Skip to content
Learn Netverks
Company prep Amadeus
Mid-level (3–5 years) Technical deep dive Medium

Explain the JavaScript event loop, call stack, and task queues

Reported in Amadeus European engineering loops. Core JavaScript concurrency model question for frontend and Node.js roles.

Role
Frontend Engineer
Location
Berlin, Germany
Study track
JavaScript

Often asked in Amadeus loops at European offices (London, Berlin, Amsterdam, Paris, Stockholm, Dublin, and remote EU). Prepare a clear spoken answer plus key trade-offs.

Try answering aloud first

Cover trade-offs, structure, and a concrete example before revealing the baseline response.

Spoiler-free prep mode

How to frame this at Amadeus: Connect your answer to measurable impact, clarity of thought, and trade-offs the team cares about. Below is a strong baseline response you can adapt with your own project examples.

JavaScript is single-threaded. The call stack runs synchronous code. Async work (timers, I/O, fetch) registers callbacks handled by Web APIs / libuv; when complete, callbacks enter task queues.

The event loop checks: if call stack empty, dequeue microtasks (Promise.then, queueMicrotask) until empty, then one macrotask (setTimeout, I/O), repeat.

Order example:

console.log("1");
setTimeout(() => console.log("2"), 0);
Promise.resolve().then(() => console.log("3"));
console.log("4");
// 1, 4, 3, 2

Explain blocking vs non-blocking I/O in Node, async/await as syntactic sugar over Promises, and starvation if microtasks recurse infinitely. Starvation of macrotasks is why long Promise chains can delay setTimeout.

Comments (0)

Share how this question came up in your loop, or add tips for others preparing.

Log in to comment on this question.