Skip to content

Node.js & Express Interview Preparation

Node.js is a JavaScript runtime built on Chrome's V8 engine that runs JavaScript outside the browser. Express is the minimal web framework almost every Node backend starts with.

Suggested Learning Order

  1. Node.js Core — event loop, modules, streams
  2. REST APIs with Express
  3. Middleware
  4. Authentication
  5. Database Integration
  6. Error Handling
  7. Interview Questions

The Mental Model

Node is single-threaded, non-blocking and event-driven.

  • One thread runs your JavaScript
  • I/O (disk, network, database) is handed off to the OS or a thread pool
  • When I/O finishes, a callback is queued
  • The event loop picks up queued callbacks and runs them

This is why Node handles thousands of concurrent connections on one thread, and why one CPU-heavy function blocks all of them.

Where Node Wins and Loses

Good atBad at
I/O-heavy APIsCPU-heavy work (image processing, crypto loops)
Real-time (WebSockets, chat)Long synchronous computation
Streaming and proxyingAnything that blocks the loop
Same language front and backHeavy multi-threaded number crunching

For CPU work: worker_threads, a child process, or a different service entirely.


Version Note

These notes assume Node 20 LTS or newer (Node 18 is end-of-life; Next.js 16 requires 20.9+). Where Express 5 changed behaviour from Express 4, both are shown — Express 5 became the default express release in 2024/2025 and the async error-handling difference is a common interview question.


What Interviewers Actually Test

AreaThe real question
Event loopCan you explain why one slow function stalls everything
async/awaitDo you handle rejections, or just chain happy paths
MiddlewareDo you understand order and next()
Error handlingDoes your API leak stack traces
AuthWhere do you put the token, and why
SecurityCan you name attacks unprompted
ScalingCluster, load balancer, stateless design

Best Practice Websites

© 2025 DDocs · Dipak's Documentation Guide