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
- Node.js Core — event loop, modules, streams
- REST APIs with Express
- Middleware
- Authentication
- Database Integration
- Error Handling
- 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 at | Bad at |
|---|---|
| I/O-heavy APIs | CPU-heavy work (image processing, crypto loops) |
| Real-time (WebSockets, chat) | Long synchronous computation |
| Streaming and proxying | Anything that blocks the loop |
| Same language front and back | Heavy 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
| Area | The real question |
|---|---|
| Event loop | Can you explain why one slow function stalls everything |
async/await | Do you handle rejections, or just chain happy paths |
| Middleware | Do you understand order and next() |
| Error handling | Does your API leak stack traces |
| Auth | Where do you put the token, and why |
| Security | Can you name attacks unprompted |
| Scaling | Cluster, load balancer, stateless design |