💻 Backend Basics Interview Questions – (Node.js)
📍 1. What is Node.js?
Answer: Node.js is a runtime environment that lets you run JavaScript on the server side. It uses Google’s V8 engine and is designed for building scalable network applications.
📍 2. How is Node.js different from traditional server-side platforms?
Answer: Unlike PHP or Java, Node.js is event-driven and non-blocking. This makes it lightweight and efficient for I/O-heavy operations like APIs and real-time apps.
📍 3. What is the role of the package.json file?
Answer: It stores metadata about your project (name, version, scripts) and dependencies. It’s essential for managing and sharing Node.js projects.
📍 4. What are CommonJS modules in Node.js?
Answer: Node uses CommonJS to handle modules. You use require() to import and module.exports to export code between files.
📍 5. What is the Event Loop in Node.js?
Answer: It allows Node.js to handle many connections asynchronously without blocking. It’s the heart of Node’s non-blocking architecture.
📍 6. What is middleware in Node.js (Express)?
Answer: Middleware functions process requests before sending a response. They can be used for logging, auth, validation, etc.
📍 7. What is the difference between process.nextTick(), setTimeout(), and setImmediate()?
Answer:
⦁ process.nextTick() runs after the current operation, before the next event loop.
⦁ setTimeout() runs after a minimum delay.
⦁ setImmediate() runs on the next cycle of the event loop.
📍 8. What is a callback function in Node.js?
Answer: A function passed as an argument to another function, executed after an async task finishes. It’s the core of async programming in Node.
📍 9. What are Streams in Node.js?
Answer: Streams let you read/write data piece-by-piece (chunks), great for handling large files. Types: Readable, Writable, Duplex, Transform.
📍 10. What is the difference between require and import?
Answer:
⦁ require is CommonJS (used in Node.js by default).
⦁ import is ES6 module syntax (used with "type": "module" in package.json).
Upload CV Get Dream Job Here👇
https://bit.ly/Dream_Job_Internship
Claim your Free $5 Bonus Here:
https://bit.ly/3wUxw09
Join our WhatsApp Channel 👇
https://whatsapp.com/channel/0029VbAi27y0lwghBe9mE42i
WhatsApp Community Link 👇
https://chat.whatsapp.com/HPJDqRr6G1sKQIqfdJF3pL
1️⃣ GROUP FOR PROGRAMMERS🖥
📎 Channel Link:
[ https://t.me/realgroupforprogrammer ]
---
2️⃣ Coding Community
📎 Channel Link:
[ https://t.me/Coding_CommunityOfficial ]
---
3️⃣ Programming Bay
📎 Channel Link:
[ https://t.me/programmingbay ]
---
4️⃣ Data Structures and Algorithms
📎 Channel Link:
[ https://t.me/datastructuresandalgoofficial ]
Share with your College Whatsapp Groups & Friends too
All the best 👍👍
Post #1416
2.33K
- ❤ 3