Node.js Interview Questions
Fundamentals
1. What is Node.js?
Node.js is a JavaScript runtime built on Chrome's V8 engine. It enables JavaScript to run on the server, with non-blocking I/O and event-driven architecture.
2. How does the event loop work?
The event loop processes callbacks from the event queue. Phases: timers, pending callbacks, poll, check, close callbacks. It allows async operations without threads.
3. What is the difference between process.nextTick and setImmediate?
process.nextTick executes callback after current operation, before event loop continues. setImmediate executes in check phase of event loop.
4. What are streams?
Streams handle reading/writing data piece by piece. Types: Readable, Writable, Duplex, Transform. Efficient for large files.
5. What is clustering?
Clustering spawns child processes to handle load across CPU cores. Master process distributes connections to worker processes.
Keep your own version of these notes — editable, searchable, and organised by your stack.
Start free