Event loop, streams, modules, concurrency, security and the modern Node.js interview essentials.
Preview — first 3 of 136 cards
What is Node.js?
V8 plus libuv. Your JS runs on one thread; the event loop multiplexes I/O, and a small libuv thread pool performs blocking syscalls (most `fs`, `crypto`, `zlib`, `dns.lookup`). Sockets use OS async (epoll/kqueue/IOCP) instead of the pool. Excellent for I/O-bound services, poor for CPU-bound work.
node -e "console.log(process.version, process.versions.uv, process.versions.v8)"
Single-threaded?
One JS thread and one isolate per process, so no JS state is shared between processes. Concurrency is interleaved I/O plus up to `UV_THREADPOOL_SIZE` (default 4) libuv threads; JS itself never runs in parallel unless you add `worker_threads`. One slow sync call blocks every request in that process.
// 8 parallel reads still queue behind the 4 pool threads
UV_THREADPOOL_SIZE=8 node -e "const fs=require('fs/promises');Promise.all(Array.from({length:8},()=>fs.readFile(__filename))).then(()=>console.log('done'))"
Event loop phases?
timers -> pending callbacks -> idle/prepare -> poll (I/O) -> check (`setImmediate`) -> close callbacks, then repeat. After each callback Node drains the `process.nextTick` queue and then the promise microtask queue. The poll phase blocks waiting for I/O when nothing else is ready.
setTimeout(() => console.log('1 timer'), 0);
setImmediate(() => console.log('2 immediate'));
Promise.resolve().then(() => console.log('3 microtask'));
process.nextTick(() => console.log('4 nextTick'));
// 4, 3, then timer/immediate order can vary at top level
133 more cards in this sheet
Unlock the Backend, Databases & AI bundle — ₹399
One-time payment. Unlocks this sheet and 14 other sheets in the bundle, plus a typeset PDF of each.
Unlock the bundle
See all bundles
Or get all 76 sheets for ₹999 — one payment, every future sheet included.