Node interviews blend JavaScript fundamentals, runtime mechanics, HTTP/API design, and production judgment. Practice concise answers with trade-offs—not buzzword lists.
Core topics to rehearse
- Event loop, microtasks vs macrotasks, blocking the main thread
- CommonJS vs ESM, npm, package-lock
- async/await error handling, streams overview
- Express middleware order, status codes, REST design
- Env config, validation, sessions/JWT, security headers
- Scaling, clustering, when to choose another runtime
Sample questions
- Q: Explain the event loop in 60 seconds.
A: Single JS thread runs sync code, drains microtasks (promises), then macrotasks (timers, I/O callbacks); libuv handles async OS work—blocking sync code stalls everything. - Q: How do you structure a small API?
A: Routes → controllers → services → data layer; validate at boundary; central error middleware; env-based config. - Q: Node vs Go for a new API?
A: Node wins team JS overlap and npm velocity; Go wins raw CPU, static binaries, and simple concurrency model—compare team, latency, and ops. - Q: Debug memory leak?
A: Reproduce load, heap snapshots, compare retained objects, check closures/event listeners and unbounded caches.
Whiteboard habit
Draw a POST /login request through middleware: logger → json parser → validator → auth service → session cookie response.
Self-check
- Can you explain middleware order without notes?
- Can you compare JWT and server sessions in one minute?
Interview: Practice explaining the event loop, middleware order, and how you would debug a slow API—whiteboard a request through Express layers.
Interview prep
- Must-know Node interview topics?
Event loop, modules, async patterns, HTTP/middleware, env config, security (validation, auth, headers), npm, and when to scale horizontally vs optimize code.