-
What is the difference between Node.js and JavaScript in the browser?
-
What is npm (Node Package Manager)?
-
What is the difference between CommonJS (
require) and ES Modules (import)? -
What are callbacks, and why are they used in Node.js?
5.A) Callback Hell?
5.B β Modern Fix: Use Promises or async/await
5.C await for task and Parallel execution with promise C
-
What is the event loop in Node.js?
- Explain phases (timers, I/O callbacks, idle, poll, check, close).
-
What are Streams in Node.js?
- Types: Readable, Writable, Duplex, Transform.
-
What are Buffers in Node.js?
- How Node.js handles binary data.
-
How does Node.js handle concurrency if itβs single-threaded?
-
What is the difference between process.nextTick() and setImmediate()?
-
What is middleware in Node.js (Express)?
- Explain request-response lifecycle.
- What are some common built-in modules in Node.js?
fs,path,http,os,events,util.
-
What are the differences between synchronous and asynchronous functions in Node.js?
-
Explain how error handling works in Node.js.
- Try/catch,
errorevents, async/await error handling.
- What is clustering in Node.js?
- How to utilize multiple CPU cores.
-
How does Node.js differ from multithreaded servers like Java or .NET?
-
What is the difference between fork(), spawn(), and exec() in child processes?
-
Explain JWT authentication in Node.js.
-
What is CORS, and how do you handle it in Node.js?
-
What is the difference between REST and GraphQL in Node.js?
- How does the V8 engine work in Node.js?
- JIT compilation, memory management, garbage collection.
- How does Node.js manage memory?
- Heap, stack, garbage collection.
-
What is libuv, and what role does it play in Node.js?
-
Explain load balancing in Node.js applications.
- Cluster mode, PM2, reverse proxies like Nginx.
-
What are worker threads in Node.js, and when should you use them?
-
How do you handle scalability in a Node.js application?
- Horizontal vs vertical scaling.
- How do you secure a Node.js application?
- Helmet, rate limiting, sanitization, avoiding eval, managing tokens.
- How do you optimize performance in Node.js applications?
- Caching, streams, clustering, avoiding synchronous code.
- What is async_hooks in Node.js?
- Tracking asynchronous resources.
- How do you debug Node.js applications?
- Node Inspector, Chrome DevTools, logging libraries.
- Write an HTTP server without Express.
- Show how to read/write a file using
fs. - Convert callback-based code into async/await.
- Demonstrate error handling in async/await.
- How to stream a large file without loading it fully into memory.
- Implement a simple middleware in Express.
- Handle race conditions with Promises.
- Write a code snippet for clustering.
π Do you want me to prepare a mock interview Q&A style (questions with short, crisp answers you can practice), or do you prefer just the list of questions for now?