Skip to content
InterviewEra
Loading account navigation
InterviewEra

InterviewEra is an AI-powered mock interview platform with adaptive follow-ups, resume-aware scoring, and structured interview preparation for campus placements and early-career hiring.

Start Mock Interview

Product

  • How It Works
  • For Teams
  • Start Mock Interview
  • Campus Placements
  • Campus Workspace
  • Help Center

Tools

  • Interview Question Generator
  • ATS Resume Checker
  • STAR Answer Builder

Resources

  • Interview Questions
  • All Resources
  • Blog
  • Community Hub
  • DSA Topic Map
  • Placement Guide
  • STAR Guide

Company

  • What is InterviewEra
  • About Us
  • Pricing
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Refund Policy

© 2026 InterviewEra. All rights reserved.

Privacy Policy|Terms & Conditions|Refund Policy
|Ranchi, Jharkhand, India
Interview Questions›Topics›Node.js

Backend · Fresher-relevant

Node.js Interview Questions 2026

Node.js interview questions on event loop, streams, async patterns, Express.js, and REST API development.

BackendFresher-relevant

Node.js Interview Questions

Placement-oriented · Updated 2026
  1. 01

    Explain the Node.js event loop.

    TechnicalHard

    Tip: Node uses a single-threaded event loop (libuv) with phases: timers, pending callbacks, poll, check (setImmediate), and close. Blocking work is offloaded to a thread pool. process.nextTick and Promise microtasks run between phases, before timers. Never block the loop with synchronous CPU work.

  2. 02

    What is the difference between process.nextTick() and setImmediate()?

    TechnicalMedium

    Tip: process.nextTick() callbacks run immediately after the current operation, before the event loop continues — they can starve I/O if overused. setImmediate() runs in the check phase, after the current poll phase completes. Use setImmediate for "run after I/O", nextTick sparingly for cleanup.

  3. 03

    How do you handle CPU-intensive tasks in Node.js without blocking?

    TechnicalMedium

    Tip: Offload to worker_threads (shared memory, good for CPU work), child_process for separate processes, or the cluster module to fork the server across CPU cores. For heavy compute, a job queue (BullMQ + Redis) processed by separate workers keeps the request path responsive.

  4. 04

    What is middleware in Express.js?

    TechnicalEasy

    Tip: Middleware are functions with (req, res, next) that run in order on the request pipeline — used for logging, body parsing, auth, and error handling. Calling next() passes control onward; error-handling middleware takes four args (err, req, res, next) and is registered last.

  5. 05

    What are Streams in Node.js and why use them?

    TechnicalMedium

    Tip: Streams process data in chunks instead of buffering it all in memory — Readable, Writable, Duplex, and Transform. Piping (readable.pipe(writable)) handles backpressure automatically. Use them for large files, HTTP bodies, and data transformation to keep memory flat.

  6. 06

    How does error handling differ for synchronous, callback, and async/await code?

    TechnicalMedium

    Tip: Synchronous code uses try/catch. Callbacks use the error-first convention (cb(err, data)). Promises use .catch(); async/await uses try/catch around awaited calls. Unhandled promise rejections crash the process in modern Node — always attach a handler or wrap in try/catch.

  7. 07

    What is the difference between require (CommonJS) and import (ES Modules)?

    TechnicalMedium

    Tip: require is synchronous, dynamic, and resolved at runtime (CommonJS). import is static, hoisted, supports tree-shaking, and can be asynchronous (ESM). ESM is enabled via "type":"module" or .mjs. You cannot freely mix them; interop requires createRequire or dynamic import().

  8. 08

    How do you prevent and detect memory leaks in a Node.js service?

    TechnicalHard

    Tip: Common causes: unbounded caches, uncleared timers, and growing global arrays or event-listener accumulation (watch for MaxListenersExceededWarning). Detect with heap snapshots in Chrome DevTools / clinic.js and by monitoring process.memoryUsage().heapUsed over time. Bound caches with an LRU and remove listeners on teardown.

Practice Node.js questions with your own resume

InterviewEra generates role-specific questions using your actual projects and skills. Get scored feedback on technical depth, clarity, and structure — free to start.

Start free mock interviewFree question generator

Roles that need Node.js

  • Backend Developer questions
  • Full Stack Developer questions
  • Node.js Developer questions

Related backend topics

  • Java questions
  • Python questions
  • REST APIs questions
  • Spring Boot questions
  • Django questions

Practice tools

  • Interview question generator
  • ATS resume checker
  • STAR answer builder

Guides and resources

  • All interview questions
  • HR interview answer tips
  • STAR method with examples