Back to Tech Interviews

Node.js Backend Interview Master

200+ Node.js interview questions covering Event Loop architecture, Libuv thread pool, Streams, Buffers, Cluster module, Worker Threads, and Express.

Total: 200 QuestionsLearned: 0 / 200 (0%)
Difficulty Filters

Tools & Options
Showing 200 of 200 questions
Beginner
What is Node.js?

Node.js is a cross-platform, open-source JavaScript runtime environment that executes JavaScript code outside a web browser. It is built on Google Chrome's V8 JavaScript engine.

Beginner
Is Node.js single-threaded?

Yes, Node.js is primarily single-threaded for its event loop, but it uses internal worker threads (via libuv) for handling expensive I/O operations like file system access or network requests.

Beginner
What is the difference between Node.js and JavaScript?

JavaScript is a programming language, whereas Node.js is a runtime environment that allows you to run JavaScript on the server side.

Beginner
What is npm?
Beginner
What is REPL in Node.js?
Beginner
What are the core modules of Node.js?
Beginner
How do you create a simple server in Node.js?
Beginner
What is the role of 'package.json'?
Beginner
What is the difference between `require` and `import`?
Beginner
What is a callback function?
Beginner
What is the Event Loop in Node.js?
Beginner
What is the difference between `setImmediate()` and `setTimeout()`?
Beginner
What is the purpose of `module.exports`?
Beginner
What is `process.argv`?
Beginner
Explain 'Non-blocking I/O'.
Beginner
What is the `fs` module?
Beginner
What is 'Callback Hell'?
Beginner
What is a Promise?
Beginner
What is Async/Await?
Beginner
What is Global Object in Node.js?
Beginner
Explain `__dirname` and `__filename`.
Beginner
What is the use of 'path' module?
Beginner
What is 'error-first callback'?
Beginner
How do you install a specific version of a package?
Beginner
What is the difference between `dependencies` and `devDependencies`?
Beginner
What is 'nodemon'?
Beginner
What is 'event-driven' programming?
Beginner
What is an EventEmitter?
Beginner
What is a Buffer in Node.js?
Beginner
What is the purpose of `os` module?
Beginner
What is 'Stream' in Node.js?
Beginner
Name the types of Streams in Node.js.
Beginner
What is 'piping' in streams?
Beginner
What is 'Chaining' in Node.js?
Beginner
What is the use of `util.promisify()`?
Beginner
What is 'Express.js'?
Beginner
What is 'Middleware' in Express?
Beginner
How do you handle routing in Express?
Beginner
What is 'body-parser'?
Beginner
What is 'REST API'?
Beginner
What is 'JSON'?
Beginner
Explain `cors` package.
Beginner
What is `dotenv`?
Beginner
What is 'Mongoose'?
Beginner
What is 'JWT'?
Beginner
How to handle file uploads in Node.js?
Beginner
What is 'Bcrypt' used for?
Beginner
What is 'Validation' in Node.js API?
Beginner
What is the difference between `null` and `undefined` in JS?
Beginner
What is 'Hoisting'?
Experience
Explain the Event Loop phases.
Experience
What are 'Microtasks' and 'Macrotasks'?
Experience
What is `process.nextTick()`?
Experience
How does Node.js handle concurrency?
Experience
Explain 'Clustering' in Node.js.
Experience
What is 'Worker Threads' module?
Experience
Difference between Cluster and Worker Threads?
Experience
How to handle memory leaks in Node.js?
Experience
Explain 'Backpressure' in Streams.
Experience
What is 'libuv'?
Experience
How to secure a Node.js API?
Experience
Explain 'authentication' vs 'authorization'.
Experience
How to scale Node.js applications?
Experience
What is 'PM2'?
Experience
Explain 'Socket.io'.
Experience
What is 'Redis' used for in Node.js?
Experience
Explain 'Stub', 'Mock', and 'Spy' in testing.
Experience
How to perform 'Graceful Shutdown'?
Experience
Explain 'Domain-Driven Design' (DDD) in Node.js.
Experience
What is 'Microservices Architecture'?
Experience
How to handle distributed tracing?
Experience
Explain 'Event Sourcing'.
Experience
What is 'CQRS'?
Experience
How to optimize expensive database queries?
Experience
Explain 'Hydration' in Node.js SSR.
Experience
How to handle 10k connections simultaneously?
Experience
Explain 'Garbage Collection' in V8.
Experience
What is 'Heap' vs 'Stack' memory?
Experience
Explain 'Proto-Pollution' vulnerability.
Experience
How to use 'crypto' module?
Experience
What is 'Passport.js'?
Experience
How to handle large file uploads to S3?
Experience
Explain 'serverless' with Node.js.
Experience
What is 'Cold Start' in Serverless?
Experience
Explain 'GRPC'.
Experience
What is 'GraphQL'?
Experience
Difference between GraphQL and REST?
Experience
How to implement 'pagination' correctly?
Experience
Explain 'Bull' or 'Bee-Queue'.
Experience
How to use 'child_process' module?
Experience
Difference between `spawn` and `exec`?
Experience
What is 'N-API'?
Experience
How to handle 'unhandledRejection' and 'uncaughtException'?
Experience
Explain 'Dependency Injection' (DI).
Experience
What is 'Inversion of Control' (IoC)?
Experience
How to implement 'Rate Limiting'?
Experience
What is 'Log Rotation'?
Experience
Explain 'Winston' or 'Pino'.
Experience
How to handle database migrations?
Experience
What is 'Circuit Breaker' pattern?
Advanced
Explain V8 Engine Pipeline.
Advanced
What is 'Hidden Classes' in V8?
Advanced
Explain 'Inlining' optimization.
Advanced
What is 'Buffer.alloc' vs 'Buffer.allocUnsafe'?
Advanced
Explain 'Zero-copy' in Node.js.
Advanced
What is 'V8 Heap Snapshot'?
Advanced
Explain 'Flame Graphs'.
Advanced
Deep Dive: libuv thread pool size.
Advanced
What is 'Isolate' in V8?
Advanced
Explain 'Crankshaft' (Legacy) vs 'TurboFan'.
Advanced
How to write Native Addons with C++?
Advanced
Explain 'SharedArrayBuffer' and 'Atomics'.
Advanced
Deep Dive: 'Tick' process in Node.js.
Advanced
What is 'Event Loop Lag'?
Advanced
How to implement Custom Streams?
Advanced
Explain 'QUIC' and 'HTTP/3' support.
Advanced
How to handle 'BigInt' in Node.js?
Advanced
Explain 'Shadow DOM' vs 'Virtual DOM'.
Advanced
What is 'Tree Shaking' in Node.js production?
Advanced
Security: 'ReDoS' (Regular Expression Denial of Service).
Advanced
How to implement 'Observability'?
Advanced
Explain 'Chaos Engineering' in Node.js.
Advanced
Deep Dive: `require()` cache.
Advanced
Explain 'Circular Dependencies' in Node.js.
Advanced
How to use 'Inspector' module?
Advanced
Explain 'Native Messaging' in Chrome Extensions via Node.
Advanced
What is 'JIT' (Just In Time) Compilation?
Advanced
How to implement 'Multi-tenant' architecture?
Advanced
Explain 'Atomic' commits with MongoDB/Node.
Advanced
How to handle 'Thundering Herd' problem?
Advanced
What is 'Symlink' in Node.js modules?
Advanced
Explain 'Module Wrapper' in Node.js.
Advanced
Difference between `exports` and `module.exports`?
Advanced
How to handle 'Zlib' for compression?
Advanced
Explain 'Pre-parsing' in V8.
Advanced
What is 'Code Cache'?
Advanced
How to build 'CLI' tools with Node.js?
Advanced
Explain 'TTY' module.
Advanced
What is 'Vm' module?
Advanced
How to implement 'A/B Testing' server-side?
Advanced
Explain 'Service Discovery' in Microservices.
Advanced
What is 'API Gateway' pattern?
Advanced
Explain 'Sidecar' pattern.
Advanced
How to handle 'Semantic Versioning' (SemVer)?
Advanced
What is 'NPM Audit'?
Advanced
Explain 'Peer Dependencies'.
Advanced
How to use 'AbortSignal' across multiple async tasks?
Advanced
What is 'Top-level Await'?
Advanced
Explain 'WebAssembly' (Wasm) with Node.js.
Advanced
How to implement 'Data Masking' for PII?
Beginner
Read a file and count words.
Beginner
Create a basic HTTP server.
Beginner
Get all files in a directory.
Experience
Convert callback-based fs.readFile to Promise.
Experience
Implement a simple EventEmitter.
Experience
How to parse JSON from body in vanilla Node?
Experience
Implement basic authentication middleware in Express.
Experience
Calculate file hash (SHA-256).
Beginner
Pipe a file to response (download).
Beginner
Merge two objects in JS.
Beginner
Check if a path is a directory or file.
Experience
How to run multiple promises in parallel?
Beginner
Implement a Delay function.
Beginner
Find unique values in array.
Beginner
Get current platform and CPU count.
Experience
Zip a file using zlib.
Experience
How to catch unhandled promise rejections?
Experience
Implement a basic Cluster worker logic.
Beginner
Filter an array of objects by property.
Beginner
Format currency in JS.
Experience
Generate a random token string.
Beginner
Check if a variable is an array.
Advanced
Implement a simple LRU cache (Logic).
Experience
How to handle timeouts in Fetch?
Beginner
Convert string to base64.
Experience
Group array of objects by a key.
Beginner
How to execute a shell command?
Beginner
Check if a string is a valid JSON.
Advanced
Implement a custom Writable stream.
Beginner
Find the intersection of two arrays.
Advanced
How to detect a memory leak in a simple loop?
Experience
Debounce a function (Generic).
Experience
Throttle a function (Generic).
Beginner
Deep clone an object (using structuredClone).
Advanced
Implement a queue using two stacks.
Beginner
Check for prime numbers.
Beginner
Reverse words in a sentence.
Experience
Find the median of an array.
Beginner
Convert epoch to human readable date.
Experience
Implement a retry logic for fetch.
Advanced
Flatten nested JSON.
Beginner
How to get query params from URL in Node?
Beginner
Capitalize first letter of string.
Beginner
Count occurrences of characters in string.
Beginner
Write a stream-based file copy function.
Experience
Find the first non-repeating character.
Experience
Implement Binary Search.
Advanced
How to use worker threads for heavy math?
Experience
Implement a simple string template engine.
Beginner
Check if two strings are anagrams.

Technical Interview Mastery Blueprint

Proven methodologies and frameworks to succeed in technical and architecture rounds.

1. The Engineering STAR Technique

When responding to architectural or situational questions, structure your answer using Situation, Technical Constraint, Action, and Measurable Result. Rather than jumping straight to syntax, articulate the business problem, why certain patterns (e.g. caching, queuing, immutability) were selected over alternatives, and what latency or throughput improvements were achieved.

2. Defending Architectural Trade-Offs

Senior interviewers evaluate how you weigh trade-offs. Always explain why you chose an approach: e.g., memory overhead vs CPU cycle speed, consistency vs availability (CAP theorem), or normalized schemas vs denormalized fast reads. Stating the drawbacks of your own proposal demonstrates maturity and production experience.

3. Clean Code & Edge-Case Proactivity

In live-coding rounds, communicate your thinking aloud before typing. State edge cases explicitly: null or undefined inputs, extreme boundary values, concurrency races, and network timeouts. Writing modular, well-named functions with deterministic unit tests separates junior candidates from staff-level engineers.

4. Antipatterns to Avoid

Avoid reciting memorized definitions without practical context. Never dismiss non-functional requirements such as security (CSRF, injection, token rotation), observability (logging, metrics), and accessibility (ARIA, semantic standards). Always ask clarifying scope questions before writing complex implementations.

Continuous learning: Practice daily, mark completed questions as learned, and revisit difficult concepts.Explore All Interview Tracks →

Explore Related Tools

Hand-picked utilities and calculators related to this tool.

Related Tools