iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up

Node Quiz

Eight quick questions on the Node runtime, event loop, streams, and modules.

Sample questions

EXAMPLE
# Node.js quiz

1) The event loop runs:
   a) JavaScript and OS-level threads concurrently
   b) one JS callback at a time on the main thread, with libuv handling I/O off the main thread
   c) only in worker threads
   d) on a separate process

2) process.nextTick() runs:
   a) after the next event loop tick
   b) before any other I/O callback in the current tick
   c) the same as setImmediate
   d) only in async functions

3) Streams in Node are:
   a) eager iterators
   b) async byte/object pipes with backpressure
   c) Promises
   d) deprecated

4) The right way to copy a big file efficiently:
   a) fs.readFile then fs.writeFile
   b) pipeline(createReadStream, createWriteStream)
   c) shell out to cp
   d) base64 encode

5) ESM vs CommonJS in 2026:
   a) CommonJS only
   b) ESM is the modern default; both interop, but new code should be ESM
   c) ESM is broken
   d) the same

6) NODE_OPTIONS is for:
   a) deprecation
   b) flags passed to node at startup (e.g. --enable-source-maps)
   c) package.json scripts
   d) shell prompt

7) Worker threads are for:
   a) network I/O
   b) CPU-bound work that would block the main loop
   c) replacing child processes
   d) DOM access

8) The safest way to handle secrets in a Node process is:
   a) hard-code in source
   b) inject via the platform's secret store (Secrets Manager, KeyVault, Doppler) and read at boot; never log them
   c) commit them to .env
   d) put them in package.json

Answers: 1b, 2b, 3b, 4b, 5b, 6b, 7b, 8b.

Why it matters

Node is single-threaded JS + libuv I/O. Streams handle backpressure; pipeline handles errors. Workers for CPU, never to dodge async. Secrets always come from a store, never the repo.

Tip: Tweak the snippet with Try it Yourself », then sit the quiz at the bottom of the page.

Example

Example
console.log('3 questions per lesson — test yourself.');
Try it Yourself »

Discussion

Loading…