Skip to the page

Backend · 19 concepts

Node.js runtime

How Node runs your code: the event loop, threads, modules, streams and errors, at the depth interviewers dig to.

Part 1 · 6 concepts

How Node runs your code

  1. 01

    What Node.js is: V8 + libuv

    Node.js is a JavaScript runtime: the V8 engine runs your JavaScript on one main thread, and the libuv library gives it an event loop and non-blocking I/O, so one…

  2. 02

    The Node event loop and its phases

    The Node event loop runs callbacks in phases (timers, pending callbacks, poll for I/O, check for setImmediate, close callbacks), and after every single callback it…

  3. 03

    process.nextTick, promises and queueMicrotask

    In CommonJS, Node empties the process.nextTick queue before the promise microtask queue after each operation, but in an ES module the top-level code itself runs as a…

  4. 04

    The libuv thread pool

    libuv keeps a small pool of threads (4 by default, changed with UV_THREADPOOL_SIZE) for work the operating system cannot do asynchronously, such as file system calls…

  5. 05

    Blocking the event loop: find it and fix it

    Any long synchronous work on the main thread, like a big loop, a huge JSON.parse, a slow regex or a *Sync API in a request handler, blocks the event loop so every other…

  6. 06

    worker_threads vs child_process vs cluster

    Use worker_threads for CPU-heavy JavaScript inside one process, child_process to run other programs or separate Node processes, and cluster (or simply more containers)…

Part 2 · 2 concepts

Modules and packages

  1. 07

    CommonJS vs ES modules in Node

    CommonJS loads modules synchronously with require and module.exports at run time, while ES modules use static import/export that is read before the code runs, load…

  2. 08

    package.json, semver and lockfiles

    package.json describes a package: its module type, its public entry points ("exports"), the Node versions it supports, its scripts and three kinds of dependencies…

Part 3 · 5 concepts

Events, buffers, streams and files

  1. 09

    EventEmitter

    EventEmitter is Node's built-in publish/subscribe class: emit() calls every listener synchronously in the order they were added, and an 'error' event with no listener…

  2. 10

    Buffers, bytes and encodings

    A Buffer is a fixed-size chunk of raw bytes (a Uint8Array subclass) that Node uses for files, sockets and crypto, and you must think in bytes and encodings, because one…

  3. 11

    Streams and pipeline

    Streams process data piece by piece instead of loading it all into memory; Node has Readable, Writable, Duplex and Transform streams, and you connect them with…

  4. 12

    Backpressure

    Backpressure is how a fast producer slows down for a slow consumer: writable.write() returns false when the buffer reaches highWaterMark, and the producer must wait for…

  5. 13

    Files and paths, safely

    Use the promise-based fs API or streams in servers, build paths with path.join or path.resolve, and never put user input into a file path without checking the final…

Part 4 · 3 concepts

Errors, memory and request context

  1. 14

    Error handling in Node

    Separate operational errors (expected failures like a timeout or bad input, which you handle and report) from programmer errors (bugs, which you log and then crash and…

  2. 15

    Memory leaks and heap snapshots

    A memory leak in Node is memory that stays reachable when it should not, usually from unbounded caches, listeners or timers that are never removed, or closures holding…

  3. 16

    AsyncLocalStorage: request context

    AsyncLocalStorage keeps a value (like a request ID or the current user) available through every await, timer and callback that starts inside one request, without…

Part 5 · 3 concepts

Modern Node in 2026

  1. 17

    Node versions, LTS and the new release schedule

    Run production on an LTS line: in November 2026 those are Node 26 (Lithium), 24 (Krypton) and 22 (Jod); Node 20 is end of life, and from Node 27 every major release…

  2. 18

    What is built into Node now

    Modern Node ships tools that used to need packages: fetch and WebSocket clients, a test runner, watch mode, .env loading, node --run, a SQLite module and a permission…

  3. 19

    Running TypeScript directly in Node

    Current Node runs .ts files directly by stripping type annotations (on by default since 23.6 and 22.18, stable since 24.12 and 25.2), but it does not type-check…

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview