Chapter quiz · Node.js for Algorithms & Interview Patterns

Test what you learned.

8 questions on Node.js for Algorithms & Interview Patterns. Pass 70% to clear the chapter.

← Review chapter lessons

Quiz

Node.js & Interview Pitfalls — Chapter Quiz

Eight questions on the event loop phases, microtasks, blocking, worker threads, streams, and common JS interview gotchas.

0/ 9
  1. Question 1
    1

    In what order does Node.js process the following after the current call stack is empty: a resolved Promise callback, a setTimeout(fn, 0) callback, and a queueMicrotask callback?

  2. Question 2
    2

    Which Node.js event loop phase processes I/O callbacks (e.g., file system, network)?

  3. Question 3
    3

    A Node.js HTTP server handles 1,000 concurrent requests. A single request triggers a CPU-intensive operation that takes 2 seconds synchronously. What happens?

  4. Question 4
    4

    Which Node.js API is the correct choice for CPU-intensive work (e.g., image compression, cryptographic hashing) that must not block the event loop?

  5. Question 5
    5

    Why should you use Node.js streams when processing a 10 GB log file?

  6. Question 6
    6

    Modifying an array while iterating over it with a for...of loop is always safe in JavaScript.

  7. Question 7
    7

    The default comparator for Array.prototype.sort() converts elements to ___ before comparing, which causes numeric arrays to sort incorrectly without an explicit comparator.

  8. Question 8
    8

    Which of the following are common JavaScript/Node.js pitfalls in coding interviews? (Select all that apply)

    Select all that apply.

Pick an answer — instant feedback as you go.