Skip to content
codinganthem

Node.js skill check

Practise Node.js: the event loop, modules, streams, Express, error handling, and scaling with workers.

15

Questions

11 min

Timer can't pause

Multiple choice

Node.js 22

Choose a level

Topics

  • Event loop
  • Modules
  • Streams
  • File system
  • Express
  • Error handling
  • Child processes and workers
  • Performance

Do

Use scratch paper or a notepad to work things out. Skip a question and come back to it later.

Don't

Look up answers during the check. Open the check in more than one tab or window.

Easy · 15 questions · 11 min

By starting, you agree to the Terms and Privacy Policy.

Start practice

Practice checks each answer as you go, with an explanation. The exam is checked when you submit; 9 of 15 passes and earns a certificate.

Checking your levels…

Certificates come from the certified exam: pass with 9 of 15 while signed in. View a sample certificate.

Sample Node.js questions with answers

These are never used in a check, so seeing their answers here won't give anything away.

  1. Question 1 · Easy · Event loop

    Which phase of the Node.js event loop executes callbacks scheduled by setImmediate()?
    1. A.Poll phase
    2. B.Check phase
    3. C.Timers phase
    4. D.Close callbacks phase
    Show answer

    B. Check phase

    The check phase is dedicated to running callbacks scheduled by setImmediate(). Poll handles I/O events, and timers handles setTimeout and setInterval.
  2. Question 2 · Easy · Modules

    In an ECMAScript module (.mjs or type: "module"), which CommonJS variable is NOT available in the global scope?
    1. A.console
    2. B.Buffer
    3. C.__dirname
    4. D.process
    Show answer

    C. __dirname

    CommonJS variables like __dirname, __filename, require, and module are not defined in ES modules. Developers typically use import.meta.url with path tools instead.
  3. Question 3 · Moderate · File system

    A Node.js HTTP server receives concurrent requests to read configuration files. Why is fs.promises.readFile() preferred over fs.readFileSync() in this server environment?
    1. A.fs.readFileSync crashes the process immediately if the requested file exceeds 64 KB
    2. B.fs.readFileSync uses more disk space during read buffers than fs.promises.readFile
    3. C.fs.readFileSync executes synchronously on the main thread, blocking the event loop from handling other incoming network requests
    4. D.fs.promises.readFile bypasses the operating system page cache to yield higher sustained throughput
    Show answer

    C. fs.readFileSync executes synchronously on the main thread, blocking the event loop from handling other incoming network requests

    Synchronous file system operations block the single JavaScript event loop thread until the entire disk I/O completes, preventing the server from accepting or processing any other incoming requests during that time.
  4. Question 4 · Advanced · Streams

    Why is stream.pipeline() preferred over readable.pipe(writable) in production Node.js applications?
    1. A.pipeline converts all stream chunks to ArrayBuffers to reduce V8 garbage collection overhead.
    2. B.pipeline automatically executes each stream stage in a separate worker thread.
    3. C.readable.pipe does not properly forward errors and can leave file descriptors or sockets open upon failure.
    4. D.readable.pipe buffers chunks indefinitely if the destination writable stream emits a backpressure signal.
    Show answer

    C. readable.pipe does not properly forward errors and can leave file descriptors or sockets open upon failure.

    The legacy .pipe() method does not destroy streams or close underlying resources when an error occurs in the middle of a pipeline. stream.pipeline ensures all streams are properly closed and destroyed upon errors or completion.

How scoring and certificates work

  • Each check has 15 multiple-choice questions with one correct answer, and one timer for the whole check. A question you leave unanswered scores nothing.
  • Practice is free without an account and shows whether each answer is right as you go, with an explanation.
  • The certified exam is scored when you submit. 60% passes, which is 9 of 15. Easy unlocks Moderate, and Moderate unlocks Advanced.
  • Passing the exam while signed in earns a free certificate, valid for one year, with its own verification page. See a sample certificate.

Free tools for Node.js: JavaScript Formatter, JSON Formatter, JWT Decoder