Node.js Event Loop Interview Questions 2026, 25 Deep Q&A with Output Puzzles

What changed in 2026 drives
Mass-recruiter offer letters are flatter for 2026 batch - the 4-5 LPA ASE band has barely budged in three years while inflation eats real wages. Premium tracks (Digital, Pro, Elite, Specialist) are still where the differential lives, and they are entirely test-driven. If you are aiming higher than the default offer, the coding round is not optional pageantry - it is the entire interview.
What I'd actually study for this
- 01Two solid coding-round answers (1 medium-hard DSA each, with edge-case discussion) > five half-baked ones
- 02One real project you can defend end-to-end - file paths, design decisions, and what you would change
- 03One DBMS schema you actually built (not a textbook ER diagram), with at least 3 join-heavy queries written from memory
- 04Three behavioural STAR stories: failure recovered, conflict handled, ownership taken
Where most candidates trip up
The single biggest mistake is treating company-specific guides as primary prep and DSA as secondary. It is the opposite. Mass recruiters use the test as a filter, but premium tracks at every IT services company use coding to allocate offer band. Spend 70% of prep time on DSA + system fundamentals, 20% on company-specific patterns, 10% on HR rehearsal. Reverse that ratio and you collect the default offer.
Editorial commentary by Aditya Sharma · written for PapersAdda · not generated, not aggregated.
The event loop is the single highest-signal Node interview topic. Candidates report that one output-order puzzle, "what is the execution order of these callbacks", separates engineers who memorized the API from those who understand Node's concurrency. This guide compiles 25 questions from candidate-reported rounds and public preparation resources, covering phases, microtasks versus macrotasks, and the tricky ordering puzzles that decide rounds.
The mental model: Node runs your synchronous code, then drains microtasks (nextTick then promises), then walks the libuv phases (timers, pending, poll, check, close), draining microtasks between each phase.
Related: Node.js Interview Questions 2026 | Express JS Interview Questions 2026 | JavaScript Interview Questions 2026 | REST API Interview Questions 2026
The phases at a glance
| Phase | Handles |
|---|---|
| Timers | setTimeout, setInterval callbacks whose threshold elapsed |
| Pending callbacks | Deferred system callbacks (some TCP errors) |
| Poll | Retrieve new I/O events; execute I/O callbacks |
| Check | setImmediate callbacks |
| Close | close events (e.g., socket.on('close')) |
Between every phase, Node drains the microtask queues: process.nextTick first, then the Promise queue.
Concept Questions (Q1 to Q12)
Q1. What is the event loop?
Q2. Is the event loop part of V8?
Q3. What are the phases of the event loop, in order?
Q4. What is the poll phase and why is it special?
Q5. What are microtasks and when do they run?
Q6. process.nextTick vs Promise.then, which runs first?
Q7. setTimeout(fn, 0) vs setImmediate(fn), which runs first?
Q8. Why can a long synchronous task freeze the whole server?
Q9. How does libuv's thread pool relate to the event loop?
Q10. How do you increase the libuv thread pool size?
Q11. What is event loop lag and how do you measure it?
Q12. How does async/await interact with the event loop?
Output-Order Puzzles (Q13 to Q22)
Q13.
console.log('1');
setTimeout(() => console.log('2'), 0);
Promise.resolve().then(() => console.log('3'));
console.log('4');
Output: 1 4 3 2. Why: sync first (1,4), then microtask promise (3), then timer macrotask (2).
Q14.
console.log('A');
process.nextTick(() => console.log('B'));
Promise.resolve().then(() => console.log('C'));
console.log('D');
Output: A D B C. Why: sync (A,D), then nextTick (B) before promise (C).
Q15.
setTimeout(() => console.log('timeout'), 0);
setImmediate(() => console.log('immediate'));
Output: nondeterministic order in the main module. Why: timer threshold vs loop startup timing.
Q16.
const fs = require('fs');
fs.readFile(__filename, () => {
setTimeout(() => console.log('timeout'), 0);
setImmediate(() => console.log('immediate'));
});
Output: immediate then timeout. Why: inside an I/O callback the loop enters the check phase (setImmediate) before the next timers phase.
Q17.
Promise.resolve().then(() => console.log('p1'));
process.nextTick(() => console.log('n1'));
Promise.resolve().then(() => console.log('p2'));
process.nextTick(() => console.log('n2'));
Output: n1 n2 p1 p2. Why: the entire nextTick queue drains before the promise queue.
Q18.
async function f() { console.log('1'); await null; console.log('2'); }
console.log('start'); f(); console.log('end');
Output: start 1 end 2. Why: code before the first await runs sync; the continuation after await is a microtask.
Q19.
setTimeout(() => {
console.log('t');
Promise.resolve().then(() => console.log('p'));
}, 0);
setTimeout(() => console.log('t2'), 0);
Output: t p t2. Why: after the first timer callback, the microtask (p) drains before the next timer.
Q20.
console.log('s');
setImmediate(() => console.log('immediate'));
process.nextTick(() => console.log('tick'));
Promise.resolve().then(() => console.log('promise'));
Output: s tick promise immediate. Why: sync, then nextTick, then promise, then the check-phase setImmediate.
Q21.
process.nextTick(() => {
console.log('tick1');
process.nextTick(() => console.log('tick2'));
});
Output: tick1 tick2. Why: nextTick callbacks scheduled during the drain are added to the same drain, which is why recursive nextTick can starve the loop.
Q22.
async function g() {
console.log('1');
await Promise.resolve();
console.log('2');
await Promise.resolve();
console.log('3');
}
g(); console.log('after');
Output: 1 after 2 3. Why: each await yields a microtask; sync after runs before any continuation.
Scenario Questions (Q23 to Q25)
Q23. Scenario: a health check times out intermittently under load. Event-loop diagnosis?
Q24. Scenario: promises seem to never resolve in order. Explain to the interviewer.
Q25. Scenario: a recursive process.nextTick froze the server. Why?
Event Loop Mock Test, 2026 Edition
5 original puzzles calibrated to the 2026 Node batch by Aditya Sharma, from candidate-reported patterns.
Question 1
process.nextTick runs relative to Promise.then:
a) after b) before c) same time d) random
Solution: The nextTick queue drains before the promise queue. Answer: (b)
Question 2
Inside an fs.readFile callback, setImmediate vs setTimeout(0):
a) timeout first b) setImmediate first c) random d) neither runs
Solution: The loop hits the check phase before the next timers phase. Answer: (b)
Question 3
A long synchronous loop in a handler causes:
a) faster responses b) the whole server to stall c) more threads d) nothing
Solution: It blocks the single JS thread and the event loop. Answer: (b)
Question 4
Code before the first await runs:
a) as a microtask b) synchronously c) in a timer d) never
Solution: Only the continuation after await is deferred. Answer: (b)
Question 5
Recursive process.nextTick is dangerous because:
a) it is slow b) new ticks join the same drain and starve I/O c) it leaks d) it throws
Solution: The loop cannot advance until the nextTick queue empties. Answer: (b)
FAQ, Node.js Event Loop Questions
Q: How important is the libuv vs V8 distinction? Candidates report it impresses interviewers; the event loop is libuv, the promise microtask queue is V8.
Q: Are output puzzles common for freshers? Yes, the simpler sync-vs-microtask-vs-timer puzzles. Deeper phase interleaving skews mid to senior.
Q: Does this change across Node versions? The core model is stable, but microtask draining around timers has been refined. Confirm behavior on the official Node docs for your version.
Q: What is the most-missed puzzle? Ordering of nextTick versus promises, and setImmediate versus setTimeout inside I/O callbacks.
You May Also Like
Methodology applied to this articlelast verified 8 Jun 2026
- No fabricated salary numbers or success rates. If we quote a range, it's sourced.
- No noun-substituted templates. This article was not generated by swapping company names in a stock prompt.
- No paid placements, sponsored coaching links, or affiliate-shilled course pushes.
Explore this topic cluster
More resources in Interview Questions
Use the category hub to browse similar questions, exam patterns, salary guides, and preparation resources related to this topic.
Paid contributor programme
Sat this this year? Share your story, earn ₹500.
First-person experience reports help future candidates prep smarter. We pay verified contributors ₹500 via UPI per accepted story - with byline.
Submit your story →Ready to practice?
Take a free timed mock test
Put what you learned into practice. Our mock tests match the 2026 pattern with timer, navigator, reveal, and score breakdown. No signup.
Start Free Mock Test →Related Articles
Airbnb Interview Questions 2026: Top Tech, HR & Behavioural Q&As for Freshers
Clearing Airbnb's fresher loop in 2026 comes down to preparing for the exact mix of questions across technical, behavioural,...
Airtel Interview Questions 2026: Top Tech, HR & Behavioural Q&As for Freshers
Clearing Airtel's fresher loop in 2026 comes down to preparing for the exact mix of questions across technical, behavioural,...
AMD Interview Questions 2026: Top Tech, HR & Behavioural Q&As for Freshers
Clearing AMD's fresher loop in 2026 comes down to preparing for the exact mix of questions across technical, behavioural,...
Atlassian Interview Questions 2026: Top Tech, HR & Behavioural Q&As for Freshers
Clearing Atlassian's fresher loop in 2026 comes down to preparing for the exact mix of questions across technical,...
Barclays Interview Questions 2026
_Last verified by [Aditya Sharma](/author/aditya-sharma/) · cross-checked against PapersAdda Hiring Pulse and...
More from PapersAdda
Amazon Interview Process 2026: Full Loop + Bar Raiser
Google Coding Interview Rounds 2026: Loop + Rubric
Accenture Interview Process 2026: Rounds & Prep
Accenture Interview Questions 2026 (with Answers for Freshers)