Event Loop Deep Dive

  1. Explain the phases of the Node.js event loop

  2. Difference between process.nextTick() and setImmediate()

  3. Difference between setImmediate() and setTimeout()

  4. How does Node.js prioritize async operations?

  5. What happens if the event loop is blocked?

  6. How do you detect event loop blocking?

  7. What is starvation in Node.js?

libuv, Threads & Concurrency

  1. What is libuv?

  2. How does libuv interact with the OS?

  3. What is a thread pool?

  4. Which library manages the thread pool in Node.js?

  5. How does Node.js handle I/O operations internally?

  6. Is Node.js truly single-threaded?

  7. What are worker threads?

  8. When should you use worker threads?

  9. What is clustering in Node.js?

  10. How does clustering improve performance?

  11. Difference between cluster and worker threads

Child Processes

  1. What is child_process in Node.js?

  2. What is fork in Node.js?

  3. Difference between spawn() and fork()

  4. How does Node.js handle child processes?

Express, APIs & Middleware

  1. Difference between application-level and router-level middleware

  2. What is error-handling middleware?

  3. What is next() in Express?

  4. How does Express handle async errors?

  5. What is request–response lifecycle in Express?

  6. What is body-parser?

  7. How do you handle errors gracefully in Express?

  8. How do you implement authentication in Node.js?

  9. How do you manage sessions in Node.js?

  10. What is Passport.js?

  11. What is CORS?

  12. How do you handle CORS?

Security

  1. What are common security vulnerabilities in Node.js?

  2. How do you secure cookies against XSS?

  3. What is CSRF and how do you prevent it?

  4. What is rate limiting?

  5. What is Helmet and why is it used?

  6. How do you securely store passwords?

  7. How do you manage secrets and configuration?

Testing & Quality

  1. What is a stub?

  2. What is mocking?

  3. Difference between unit, integration, and end-to-end tests

  4. What is a test pyramid?

  5. What is code coverage?

  6. How do you test asynchronous functions?

  7. What tools ensure consistent code style?

Databases & Integration

  1. Difference between SQL and NoSQL databases

  2. How does Node.js connect to databases?

  3. Can Node.js support JSON-based databases?

  4. How does Node.js communicate with external services?