Node.js Interview Questions & Answers
Prepare for Node.js technical interviews with 100 curated questions and answers — from fundamentals to Tech Lead. Runtime, streams, security, and scalable Node services. Each question includes a short interview answer, detailed explanation, examples, tips, and common mistakes.
Node.js interview topics
Jump into a category — each bank is independent and interview-focused.
Runtime
6 Node.js questions
Event Loop
6 Node.js questions
Streams
6 Node.js questions
Buffers
5 Node.js questions
File System
6 Node.js questions
Async Programming
6 Node.js questions
Modules
6 Node.js questions
APIs
6 Node.js questions
Express Concepts
6 Node.js questions
Authentication
6 Node.js questions
Security
6 Node.js questions
Performance
6 Node.js questions
Scaling
6 Node.js questions
Clustering
5 Node.js questions
Processes
6 Node.js questions
Memory
6 Node.js questions
Error Handling
6 Node.js questions
All Node.js interview questions
Runtime interview questions
View categoryWhat is the Node.js runtime, and how does it differ from browser JavaScript?
freshExplain the roles of V8 and libuv in Node.
juniorWhat does `process` expose that matters in production services?
juniorWhen would you choose Node vs a threaded runtime for a backend?
midWhat are Node's module systems today?
seniorLead: how do you standardize Node runtime versions across a large org?
seniorEvent Loop interview questions
View categoryDescribe the Node.js event loop phases at a high level.
freshWhat is the difference between `process.nextTick` and `Promise.then` / queueMicrotask?
juniorsetTimeout(fn, 0) vs setImmediate(fn) — which runs first?
juniorHow can heavy synchronous work break the event loop?
midScenario: API p99 latency jumps but CPU is low. Event loop related?
seniorLead: how do you teach teams to reason about event-loop safety?
seniorStreams interview questions
View categoryWhat are Node streams and why use them?
freshExplain backpressure in Node streams.
juniorpipe vs pipeline — which should you use?
juniorHow do you implement a Transform stream?
midDebugging: memory grows while streaming a large file upload. Likely causes?
seniorArchitecture: design a high-throughput log shipping agent in Node.
seniorBuffers interview questions
View categoryFile System interview questions
View categoryfs.promises vs fs callbacks vs sync APIs — which in servers?
freshHow do you safely write a file atomically?
juniorWhat path traversal risks exist with user-provided filenames?
juniorcreateReadStream vs readFile for large files?
midHow does the libuv thread pool affect heavy fs workloads?
seniorLead: design a multi-tenant file storage layer on local disk + S3.
seniorAsync Programming interview questions
View categoryCallbacks, promises, and async/await — how do you choose?
freshWhat is the danger of unhandled promise rejections?
juniorPromise.all vs Promise.allSettled vs Promise.race — when?
juniorHow do you implement a timeout around an async operation?
midScenario: sequential awaits in a loop make an API slow. Fix?
seniorExplain async context / AsyncLocalStorage use cases.
seniorModules interview questions
View categoryAPIs interview questions
View categoryhttp.createServer vs frameworks — when is bare http enough?
freshHow do you handle request body parsing safely?
juniorWhat headers matter for reverse-proxy deployments?
midHTTP/2 or HTTP/3 in Node services — practical take?
midHow do you design idempotent APIs in Node?
seniorDebugging: intermittent 502s from Node behind nginx.
leadExpress Concepts interview questions
View categoryWhat is Express middleware and how does the chain work?
freshHow do you structure a large Express app?
juniorapp.use(express.json()) pitfalls?
midError-handling middleware signature?
midExpress vs Fastify vs bare http — trade-offs?
seniorScenario: memory leak in Express after adding session middleware.
leadAuthentication interview questions
View categorySession cookies vs JWT in Node APIs — trade-offs?
freshHow do you store passwords correctly?
juniorImplementing refresh token rotation — key points?
midOAuth2 authorization code + PKCE — why for SPAs/mobile?
midWhere should auth middleware run relative to rate limiting?
seniorLead: multi-service auth for a Node platform?
leadSecurity interview questions
View categoryWhat is prototype pollution and how does it show up in Node?
freshHow do you prevent SSRF in a Node URL-fetching feature?
juniorchild_process with user input — safe patterns?
midDependency supply-chain hardening for Node?
midHelmet and security headers — enough?
seniorLead: threat model a public Node API gateway.
leadPerformance interview questions
View categoryHow do you profile a slow Node service?
freshWhen do worker_threads help vs hurt?
juniorJSON.stringify on huge objects in the request path — issue?
midConnection pooling best practices for Node DB clients?
midWhat Node flags/metrics help GC tuning conversations?
seniorLead: define performance budgets for Node microservices.
leadScaling interview questions
View categoryVertical vs horizontal scaling for Node apps?
freshWhat must be externalized to scale Node horizontally?
juniorHow do queues help scale Node workloads?
midCaching strategies in Node services?
midScenario: one noisy neighbor tenant saturates a shared Node API.
seniorLead: capacity plan a Node fleet for Black Friday.
leadClustering interview questions
View categoryProcesses interview questions
View categorychild_process.spawn vs exec vs fork — differences?
freshHow do you gracefully shut down a Node HTTP server?
juniorWhat is IPC between Node processes used for?
midDebugging: zombie/orphan child processes after deploys.
seniorWhen to use worker_threads vs child_process?
seniorLead: multi-process architecture for a Node PDF rendering service.
leadMemory interview questions
View categoryHow do you diagnose a Node memory leak?
juniorprocess.memoryUsage() fields — what do they mean?
juniorWhy can Buffer usage grow rss without huge heapUsed?
midIn-process caches — safe patterns?
seniorScenario: heap grows only in production under traffic.
seniorLead: memory SLOs for Node services on K8s.
leadError Handling interview questions
View categoryoperational vs programmer errors in Node — why distinguish?
juniorWhy is try/catch around an async function call without await ineffective?
juniorShould you catch uncaughtException and keep running?
midHow do you model errors for APIs?
seniorExpress async errors — patterns?
seniorLead: error budget and incident taxonomy for Node platforms.
lead