issue 117apr 27mmxxvi
est. 2026
delhi/ncr edition
vol. IX · no. 117
PapersAdda
placement intelligence, source-anchored
1,000+ briefs · 24 campuses · 120+ companies
verified offers · sourced from r/developersIndia
razorpay₹65.00 LPA· iit-d · sde-1google₹54.00 LPA· iiit-h · swe-imicrosoft₹49.50 LPA· iit-b · sdeatlassian₹38.00 LPA· nit-w · sde-1amazon₹44.20 LPA· bits-p · sde-1uber₹42.00 LPA· iit-kgp · sde-1razorpay₹65.00 LPA· iit-d · sde-1google₹54.00 LPA· iiit-h · swe-imicrosoft₹49.50 LPA· iit-b · sdeatlassian₹38.00 LPA· nit-w · sde-1amazon₹44.20 LPA· bits-p · sde-1uber₹42.00 LPA· iit-kgp · sde-1
section: Interview Questions / interview questions
08 Jun 2026
placement brief / Interview Questions / interview questions / 08 Jun 2026

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

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...

on this page§ 07
advertisement

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

PhaseHandles
TimerssetTimeout, setInterval callbacks whose threshold elapsed
Pending callbacksDeferred system callbacks (some TCP errors)
PollRetrieve new I/O events; execute I/O callbacks
ChecksetImmediate callbacks
Closeclose 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

advertisement
Sources and review notesreviewed 8 Jun 2026
Article-specific sources
Verification window
Page last edited 8 Jun 2026 by Aditya Sharma. A review date records an editorial edit, not a guarantee that every external fact is still current.
Evidence labels

Official notices, candidate reports, offer documents, and editorial practice questions carry different confidence levels. The visible source list lets you inspect the evidence instead of relying on a blanket verification badge.

Verification policy: /editorial-standards/. Found something incorrect? Submit a correction - we respond within 48 hours.

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.

Open Interview Questions hubBrowse all articles

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 guides
more from PapersAdda
Company Placement PapersFlipkart Placement Papers 2026, Complete Guide with Solutions
15 min read
Company Placement PapersGoogle Placement Papers 2026, Complete Guide with Solutions
16 min read
Company Placement PapersRazorpay Placement Papers 2026, Complete Guide with Solutions
18 min read
Exam PatternsInfosys Power Programmer Coding 2026: How PP Differs From SP
7 min read

Share this guide