Back to Prep Library
Category Blueprint
Node.js Interview Library
Event loop, asynchronous operations & scalable APIs
Questions137
Views92.5k
Upvotes5.8k
Filter
Question Catalog
(137 visible)Node.js· Backend
How do you enable gzip/Brotli compression for HTTP responses?
1.2k54
easy
Node.js· Phone Screen
What is the difference between dependencies, devDependencies, and peerDependencies?
1.1k38
easy
Node.js· Phone Screen
Explain the difference between require() and import in Node.js.
1.0k36
easy
Node.js· Frontend
Explain the concept of 'middleware' in Express.js.
1.0k34
easy
Node.js· Frontend
How do you handle CORS (Cross-Origin Resource Sharing) in Node.js?
99150
easy
Node.js· Phone Screen
What are stream piping and the .pipe() method in Node.js?
97836
easy
Node.js· Backend
What does the Node.js --watch flag do and how does it replace nodemon?
95420
easy
Node.js· Phone Screen
What is the difference between readFile and createReadStream in Node.js?
88366
easy
Node.js· Phone Screen
What is the role of the path module and why is it preferred over manual string concatenation?
87354
easy
Node.js· Phone Screen
Explain how modules work in Node.js.
82510
easy
Node.js· Phone Screen
What are the main security risks of using the 'eval()' function in Node.js?
8102
easy
Node.js· Phone Screen
What is the difference between string concatenation and path.join/path.resolve?
70471
easy
Node.js· Phone Screen
How do you run Node.js processes as a background service?
69175
easy
Node.js· Backend
What is npx and how does it differ from a global install?
64621
easy
Node.js· Backend
What does NODE_ENV=production actually change and why does it matter?
61975
easy
Node.js· Phone Screen
What is Node.js and why is it popular?
59451
easy
Node.js· Backend
What is structuredClone and when is it useful in Node.js?
54942
easy
Node.js· Phone Screen
What is the purpose of the assert module in Node.js?
50951
easy
Node.js· Backend
How do you replicate __dirname in ES Modules using import.meta.url?
47267
easy
Node.js· Phone Screen
What is the purpose of the util.promisify function in Node.js?
45267
easy
Node.js· DSA
What is the difference between blocking and non-blocking I/O in Node.js?
4311
easy
Node.js· Phone Screen
What is the use of the 'os' module in Node.js?
41743
easy
Node.js· Phone Screen
What is `npm` and what are its core functionalities?
3906
easy
Node.js· Phone Screen
How can you securely store and verify passwords in a Node.js application?
33946
easy
Node.js· Phone Screen
What is the role of the V8 JavaScript engine in Node.js?
32932
easy
Node.js· Phone Screen
Explain the concept of REPL in Node.js
3142
easy
Node.js· Phone Screen
What is the purpose of `__dirname` and `__filename` in Node.js?
30416
easy
Node.js· Phone Screen
Explain the purpose of `package.json` and `npm`.
29422
easy
Node.js· Backend
What is semantic versioning and how do ^, ~, and exact versions behave?
28064
easy
Node.js· Backend
What is the node:util parseArgs helper for building CLIs?
22247
easy
Node.js· Backend
What is the difference between unit, integration, and end-to-end tests for a Node.js API?
9821
easy
Node.js· Phone Screen
What is the purpose of `package-lock.json`?
5119
easy
Node.js· Phone Screen
How do you handle environment variables in Node.js?
4859
easy
Node.jsAmazon· DSA2024, 2022
How does the Node.js event loop work?
2.9k79
medium
Node.js· Backend
What is AbortSignal.timeout and how do you cancel async work cleanly?
1.2k71
medium
Node.js· Backend
How do you mock modules, timers, and network calls in Node.js tests?
1.2k76
medium
Node.js· System Design
How would you implement caching in a Node.js application?
1.2k72
medium
Node.js· System Design
Explain the concept of 'event-driven architecture' in Node.js.
1.2k31
medium
Node.js· Low-Level Design
What are 'Event Emitting' patterns and how does error-first callback convention relate to them?
1.2k17
medium
Node.js· System Design
When would you choose Node.js over other backend technologies?
1.1k44
medium
Node.js· Low-Level Design
How do you manage configuration in a Node.js application for different environments?
1.1k77
medium
Node.js· Backend
How do you implement a custom Transform stream?
1.1k52
medium
Node.js· Backend
What are npm workspaces and how do you manage a monorepo with them?
1.1k79
medium
Node.js· System Design
What are some best practices for structuring a Node.js project?
1.1k39
medium
Node.js· System Design
What are Worker Threads in Node.js and when would you use them?
1.1k20
medium
Node.js· Frontend
How do you manage sessions and authentication in a Node.js web application?
1.1k76
medium
Node.js· Phone Screen
What is the difference between spawn() and exec() in Node.js?
1.1k42
medium
Node.js· System Design
What is a background job queue (BullMQ/Redis) and when do you need one?
1.1k56
medium
Node.js· System Design
What is the 12-factor app methodology as applied to Node.js services?
98554
medium
Node.js· Low-Level Design
How does Node.js handle crypto operations efficiently without blocking the event loop?
9677
medium
Node.js· Low-Level Design
Explain how the EventEmitter class works under the hood.
96774
medium
Node.js· System Design
How does Node.js handle multi-threading behind the scenes if JavaScript is single-threaded?
9581
medium
Node.js· DSA
What are Promises in Node.js and how do they improve async code?
95765
medium
Node.js· Backend
What is Helmet and which HTTP security headers should a Node.js API set?
94677
medium
Node.js· Backend
What is the difference between "type": "module", .mjs, and .cjs?
93146
medium
Node.js· Backend
What is top-level await and what are its caveats in Node.js ESM?
92530
medium
Node.js· Low-Level Design
What is the purpose of the AbortController in modern Node.js?
91133
medium
Node.js· Backend
What are the differences between npm, Yarn, and pnpm?
85950
medium
Node.js· DSA
How does `async/await` work and what are its benefits?
85857
medium
Node.js· Low-Level Design
What are `EventEmitter`s in Node.js?
84619
medium
Node.js· Backend
How do you design liveness and readiness health-check endpoints?
8402
medium
Node.js· Backend
What does the events.once() helper do and how does it bridge EventEmitter and async/await?
76879
medium
Node.js· Low-Level Design
Explain how the 'crypto' module secures sensitive data in Node.js
76538
medium
Node.js· Low-Level Design
Explain the differences between fork(), spawn(), and exec() in the child_process module.
76273
medium
Node.js· Backend
How do you implement real-time communication with WebSockets (ws) in Node.js?
73313
medium
Node.js· Backend
What is the Repository pattern and how does it decouple business logic from the database?
72166
medium
Node.js· DSA
Explain the Node.js event loop.
71862
medium
Node.js· System Design
How do you monitor a Node.js application's memory usage in production?
71153
medium
Node.js· System Design
How do you containerize a Node.js app with a small, secure Docker image (multi-stage, distroless)?
69464
medium
Node.js· Backend
How do you implement retries with exponential backoff and jitter?
67614
medium
Node.js· Backend
How do you manage database schema migrations in a Node.js project?
67568
medium
Node.js· Low-Level Design
How do you handle errors in Node.js applications?
66761
medium
Node.js· Backend
What is the perf_hooks module and how do you measure performance?
6530
medium
Node.js· Backend
How do you implement Server-Sent Events (SSE) in Node.js?
64960
medium
Node.js· Backend
How do you limit the concurrency of many async operations (p-limit / promise pool)?
64755
medium
Node.js· System Design
How do you protect a Node.js API against Denial of Service (DoS) and brute-force attacks?
61723
medium
Node.js· Low-Level Design
What are Node.js Streams and when would you use them?
61559
medium
Node.js· Backend
What is the difference between an ORM, a query builder, and a raw driver?
57025
medium
Node.js· System Design
How do you implement rate limiting in a Node.js Express application?
56475
medium
Node.js· Backend
How do you run TypeScript directly in Node.js (native type stripping, tsx, ts-node)?
52870
medium
Node.js· System Design
What is the purpose of the cluster module and how does it utilize multi-core CPUs?
52441
medium
Node.js· Low-Level Design
How does the thread pool work in Node.js?
51553
medium
Node.js· Backend
How do you prevent SQL injection in Node.js database access?
50344
medium
Node.js· Backend
How do you implement structured logging with pino or winston, and why avoid console.log in production?
49623
medium
Node.js· Low-Level Design
Describe the `Buffer` class in Node.js and its use cases.
4671
medium
Node.js· Backend
What is the built-in node:test runner and how does it compare to Jest and Mocha?
43413
medium
Node.js· Low-Level Design
How do you handle uncaught exceptions and unhandled promise rejections in Node.js?
42374
medium
Node.js· System Design
What are some common security best practices in Node.js applications?
3904
medium
Node.js· Backend
What is PM2 and what does it add over running `node server.js` directly?
38770
medium
Node.js· Backend
What is the difference between JWT and session-based authentication, and where do refresh tokens fit?
38431
medium
Node.js· Low-Level Design
How can you debug a Node.js application?
38354
medium
Node.js· System Design
How do you handle database connection pooling in a Node.js application?
38248
medium
Node.js· Backend
What is undici and why is the global fetch built on it in modern Node.js?
37539
medium
Node.js· Low-Level Design
What is the purpose of the 'zlib' module in Node.js?
29736
medium
Node.js· Phone Screen
Describe the Node.js module system. What are CommonJS and ES Modules?
24819
medium
Node.js· Low-Level Design
Explain how to read and write large files using streams in Node.js
22857
medium
Node.js· DSA
Explain what 'callback hell' is and how to avoid it.
20757
medium
Node.js· Backend
How do you handle streaming multipart file uploads (busboy/multer)?
19377
medium
Node.js· Phone Screen
What are 'unhandledRejections' and how do they differ from 'uncaughtExceptions'?
12480
medium
Node.js· System Design
Explain how clustering works in Node.js.
8639
medium
Node.js· Backend
How do you validate and sanitize request input (zod / joi)?
6077
medium
Node.js· Backend
What is the difference between `npm ci` and `npm install`?
5922
medium
Node.js· DSA
What is `process.nextTick()` and `setImmediate()` and when to use them?
1.2k33
hard
Node.js· Backend
How do you profile CPU usage with --prof, 0x, or clinic.js flame graphs?
1.1k37
hard
Node.js· Low-Level Design
How do you handle circular dependencies in Node.js?
1.1k14
hard
Node.js· Low-Level Design
Explain how memory management and Garbage Collection work in the V8 engine.
1.1k60
hard
Node.js· Backend
What is a ReDoS (Regular Expression Denial of Service) attack and how do you avoid it?
1.0k23
hard
Node.js· Backend
What is diagnostics_channel and when would you use it?
1.0k47
hard
Node.js· System Design
When would you use `child_process` module in Node.js?
1.0k29
hard
Node.js· System Design
How do you implement a circuit breaker for unreliable downstream services?
97562
hard
Node.js· Low-Level Design
What are memory leaks in Node.js and how do you detect them?
9509
hard
Node.js· Low-Level Design
What is backpressure in Node.js streams and how do you handle it?
87677
hard
Node.js· Low-Level Design
How does the Node.js 'dns' module differ from browser-based DNS resolution?
87557
hard
Node.js· System Design
How do you handle graceful shutdown in a Node.js application?
8684
hard
Node.js· System Design
How do you implement microservices communication in Node.js?
83630
hard
Node.js· Backend
What is SSRF and how do you mitigate it in a Node.js backend?
8295
hard
Node.js· System Design
What is the purpose of the HTTP Agent in Node.js?
78475
hard
Node.js· System Design
How do you achieve concurrency in Node.js since it's single-threaded?
6597
hard
Node.js· System Design
What are some common ways to improve performance in a Node.js application?
65222
hard
Node.js· Backend
What are Single Executable Applications (SEA) in Node.js?
63758
hard
Node.js· Low-Level Design
Explain the concept of 'Event Loop Pollution' and how to avoid it.
5232
hard
Node.js· Backend
How does HTTP/2 support work in Node.js and how does it differ from HTTP/1.1?
48563
hard
Node.js· Backend
What are the Web Streams API (ReadableStream/WritableStream) in Node.js and how do they differ from node:stream?
47854
hard
Node.js· System Design
Describe the Node.js architecture.
44931
hard
Node.js· Low-Level Design
Explain 'dependency injection' and how it can be used in Node.js.
4422
hard
Node.js· Low-Level Design
What is the 'vm' (Virtual Machine) module and when would you use it?
4047
hard
Node.js· Backend
What is the package.json "exports" field and conditional exports?
40457
hard
Node.js· System Design
How do you secure your Node.js API endpoints?
38377
hard
Node.js· Backend
How do you build a worker-thread pool (e.g. Piscina) for CPU-bound work?
37074
hard
Node.js· System Design
How do you guarantee idempotency in a queue consumer?
3641
hard
Node.js· Backend
What is AsyncLocalStorage and what problem does it solve?
3355
hard
Node.js· Backend
What is prototype pollution and how do you prevent it in Node.js?
31763
hard
Node.js· System Design
What is the role of `libuv` in Node.js?
3132
hard
Node.js· Backend
How do you add OpenTelemetry distributed tracing to a Node.js service?
30771
hard
Node.js· Backend
How do database transactions work in Node.js and how do you avoid connection leaks?
28438
hard
Node.js· Backend
How do you capture and analyze a heap snapshot to find a memory leak?
2317
hard
Node.js· Backend
What is the Node.js permission model (--permission) and what does it protect against?
5716
hard
Difficulty Distribution
Easy33 (24%)
Medium69 (50%)
Hard35 (26%)
Hiring Companies
Tested Topics
#nodejs#security#performance#architecture#streams#async#npm#modules
Study Guide
Master the Event Loop lifecycle, asynchronous primitives (Worker Threads, child processes), streaming pipelines, and backpressure management.