NODE 20+ · 15 QUESTIONS · ABOUT 12 MINUTES

One thread. Everything in order.

Node runs your code on a single thread and queues everything else. Knowing which queue runs first is most of the job. Fifteen snippets on the event loop, modules, async errors and streams, each explained. No sign-up, nothing saved.

Start the Node.js test
setTimeout(() => log("B"), 0);Promise.resolve().then(() => log("C"));process.nextTick(() => log("D"));log("A");
outputA D C B
QUESTION 1 / 15 · EVENT LOOPEasy

What does this print?

log("A");setTimeout(() => log("B"), 0);Promise.resolve().then(() => log("C"));log("D");

What this Node.js test measures, in short

This test checks whether you can predict what Node.js does at runtime: the order of timers, immediates, nextTick and promises, how CommonJS and ES modules load, what happens to async errors, and how buffers, streams and events behave.

Snippets assume Node 20 or later, CommonJS unless marked, with log as console.log. Frameworks like Express aren't covered. The questions are our own and not standardised, so treat the result as a knowledge check, not a certification.

By What's Your IQ · Reviewed 4 Oct 2026
Format
15 predict-the-output questions, 4 options each
Topics
Event loop, modules, async and errors, buffers and streams, events and process
Assumes
Comfortable JavaScript, including promises
Runtime
Created by Ryan Dahl; first released 2009
THE EVENT LOOP, STEP BY STEP

Four queues, one predictable order

This runs inside an I/O callback, where the order is guaranteed. (At the top level of a script, timeout vs immediate can go either way.) Step through to watch each queue fill and drain.

1fs.readFile(__filename, () => {2 setTimeout(() => log("timeout"), 0);3 setImmediate(() => log("immediate"));4 Promise.resolve().then(() => log("promise"));5 process.nextTick(() => log("nextTick"));6 log("sync");7});
nextTick1st
empty
Microtasks2nd
empty
Check (setImmediate)phase
empty
Timersphase
empty
OUTPUT…
The file has been read. Its callback runs in the poll phase, on the main thread.
1 / 10
DON'T BLOCK THE LOOP

Works on your laptop, stalls in production

FRAGILE
app.get("/report", (req, res) => { const data = fs.readFileSync("big.csv"); res.send(summarise(data));});
IDIOMATIC
import { readFile } from "node:fs/promises";app.get("/report", async (req, res) => { const data = await readFile("big.csv"); res.send(summarise(data));});

readFileSync blocks the only thread, so every other request waits while one file loads. The promise version lets the loop serve others meanwhile.

Non-blocking I/Othe bet Node was built onInstead of a thread per connection, one thread hands slow work (disk, network) to the system and carries on. That's why blocking it, even briefly, hurts every user at once.1
2009 · 2010JavaScript on the server. Ryan Dahl presented Node at JSConf EU 2009, built on Chrome's V8 engine. npm followed in 2010.1
2014 → 2015Fork and reunion. Contributors forked Node as io.js over governance, then merged back under the new Node.js Foundation.2
2018Regrets, and Deno. Dahl's talk on design regrets about Node (node_modules, security, callbacks) introduced Deno, a new runtime.3
2023 · 20Batteries included. A stable built-in test runner and an experimental permission model reduced reliance on third-party tools.2
  1. Dahl, R. (2009). Node.js. Talk at JSConf EU, Berlin.
  2. OpenJS Foundation. About Node.js and release notes. nodejs.org.
  3. Dahl, R. (2018). 10 things I regret about Node.js. JSConf EU.

Where to go next

You can juggle four queues. How's your working memory?

Our full IQ test measures the logic and working memory behind good code: 60 questions across four domains, about 30 minutes.

Take the full IQ test