0% found this document useful (0 votes)
7 views4 pages

NodeJS Interview Questions Basic To Advanced

This document contains a comprehensive list of Node.js interview questions ranging from basic to advanced levels. It covers topics such as modules, asynchronous programming, error handling, security, performance, architecture, databases, testing, and real-world applications. Additionally, it includes coding questions that require practical implementation skills in Node.js.

Uploaded by

sahilstake29
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

NodeJS Interview Questions Basic To Advanced

This document contains a comprehensive list of Node.js interview questions ranging from basic to advanced levels. It covers topics such as modules, asynchronous programming, error handling, security, performance, architecture, databases, testing, and real-world applications. Additionally, it includes coding questions that require practical implementation skills in Node.js.

Uploaded by

sahilstake29
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

NODE.

JS INTERVIEW QUESTIONS — BASIC TO ADVANCED

--------------------------------------------
BASIC QUESTIONS
--------------------------------------------
1. What is Node.js and why is it used?
2. How does Node.js work internally?
3. What is the V8 engine?
4. What is the difference between Node.js and JavaScript (in the browser)?
5. What are the main features of Node.js?
6. What is an event-driven architecture?
7. What is the event loop in Node.js?
8. Explain the call stack and event queue.
9. What are asynchronous and synchronous functions?
10. What are callbacks in Node.js?
11. What are Promises?
12. What is async/await and how does it simplify async code?
13. What are Node.js global objects? Give examples.
14. What is process in Node.js?
15. What is require() and how does it work?
16. What is the difference between require() and import?
17. What are modules in Node.js?
18. Explain CommonJS vs ES Modules.
19. What are environment variables and how do you use them in Node.js?
20. How do you handle command-line arguments in Node.js?

--------------------------------------------
INTERMEDIATE QUESTIONS
--------------------------------------------
Modules and NPM:
1. What is NPM (Node Package Manager)?
2. What are package.json and package-lock.json?
3. What is the difference between dependencies and devDependencies?
4. What are peer dependencies?
5. How do you create your own Node.js module/package?
6. How do you update or uninstall packages?
7. What is semantic versioning in Node.js?

HTTP and Express.js:


1. How do you create a simple HTTP server in Node.js?
2. What is Express.js and why is it used?
3. What are middleware functions in Express?
4. What are the types of middleware in Express?
5. What is the difference between app.use() and app.get()?
6. How do you handle routing in Express.js?
7. How do you handle errors in Express middleware?
8. How can you send static files using Express?
9. How do you parse JSON or form data in Express?
10. What is CORS and how do you enable it?
11. How do you handle file uploads in Node.js?

Asynchronous Programming:
1. Difference between callbacks, promises, and async/await?
2. What are callback hell and how to avoid it?
3. What are microtasks and macrotasks?
4. Explain event loop handling asynchronous operations.
5. What are process.nextTick() and setImmediate()?
6. How do you handle multiple async operations simultaneously?

File System & Streams:


1. How do you read and write files in Node.js?
2. Difference between sync and async file operations?
3. What are streams in Node.js?
4. What are types of streams?
5. How does backpressure work?
6. What is pipe()?
7. How do you watch file changes?

Error Handling:
1. How do you handle exceptions in Node.js?
2. Operational vs programmer errors?
3. try-catch vs .catch()?
4. What happens if an unhandled exception occurs?
5. What is process.on('uncaughtException')?
6. How do you debug a Node.js app?

Security:
1. How do you secure a Node.js application?
2. Common security threats?
3. What is Helmet.js?
4. How do you handle rate limiting?
5. How do you prevent directory traversal attacks?
6. How do you sanitize inputs?

Performance:
1. How do you improve performance?
2. What is clustering?
3. How do you use the cluster module?
4. What are worker threads?
5. What is load balancing?
6. What is PM2?
7. How do you handle memory leaks?

--------------------------------------------
ADVANCED QUESTIONS
--------------------------------------------
Architecture & Design:
1. How does Node.js handle multiple requests with a single thread?
2. What is non-blocking I/O?
3. Explain reactor pattern.
4. How do you implement caching?
5. What is Redis integration?
6. What is message queuing (RabbitMQ, Kafka)?
7. How do you scale Node.js apps?

Databases:
1. How to connect Node.js with MongoDB/MySQL/PostgreSQL?
2. What is Mongoose?
3. How to perform CRUD operations?
4. What is connection pooling?
5. How do you handle database transactions?

Testing & DevOps:


1. How do you test Node.js applications?
2. Popular testing frameworks?
3. Integration testing?
4. What is CI/CD?
5. How do you deploy Node.js?

Real-World:
1. How do you structure a large project?
2. Best practices for Node.js development?
3. Logging in Node.js?
4. Monitoring performance?
5. What are microservices?
6. API versioning?
7. WebSockets / real-time chat?
8. Authentication (JWT, OAuth, Sessions)?

--------------------------------------------
CODING QUESTIONS
--------------------------------------------
1. Create REST API with CRUD operations.
2. Simple HTTP server returning “Hello World”.
3. Read/write file asynchronously.
4. Middleware that logs all incoming requests.
5. Error-handling middleware in Express.
6. JWT authentication in Express.
7. Copy file using streams.
8. Async/await with try-catch.
9. Chat app using Socket.IO.
10. Implement rate limiting middleware.

--------------------------------------------

You might also like