Backend Technologies · JavaScript / TypeScript
Node.js — Free Learning Resources
Free, printable resources for Node.js — practice problems, quick-reference cheatsheet, and an interview prep sheet. No sign-up required.
Node.js — Practice Worksheet
Structured exercises and problems to build hands-on Node.js skills. Work through key concepts step by step.
Node.js — Cheatsheet
One-page quick-reference for Node.js — key syntax, commands, patterns, and best practices at a glance.
Node.js — Interview Sheet
Top Node.js interview questions with concise answers. Get ready for any technical round with this focused prep sheet.
About Node.js
Node.js is a JavaScript runtime built on Chrome's V8 engine that enables server-side JavaScript execution. Its event-driven, non-blocking I/O model makes it exceptionally efficient for real-time applications, REST APIs, and data streaming. With npm's two-million-package ecosystem, Node.js is the backbone of modern full-stack JavaScript development.
Node.jsCheat Sheet — What's Covered
- ✓Event loop mechanics — call stack, task queue, and microtask queue
- ✓Core modules: fs, http, path, stream, EventEmitter, and cluster
- ✓npm / package.json — scripts, dependencies, semver, and workspaces
- ✓Async patterns: callbacks, Promises, async/await, and error handling
- ✓Streams, Buffers, and child_process for system-level operations
Frequently Asked Questions — Node.js
How does the Node.js event loop work?
Node.js runs on a single thread. Synchronous code runs first. Completed I/O callbacks queue for the event loop phases: timers → I/O callbacks → poll → check (setImmediate) → close callbacks. Promise microtasks are processed after each phase, before the next.
What is the difference between require() and import in Node.js?
require() is CommonJS — synchronous and the historic default. import is ESM — static, tree-shakeable, and the modern standard. Use ESM by setting "type": "module" in package.json or using .mjs extensions. Most new packages ship dual CJS/ESM builds.
How do you handle errors in async Node.js code?
With callbacks: check the first argument (if err). With Promises: .catch(). With async/await: try/catch. Add process.on('unhandledRejection', handler) as a global safety net. Never silently swallow errors.
What is the difference between process.nextTick() and setImmediate()?
process.nextTick() fires before the event loop moves to the next phase — after the current synchronous code, before any I/O. setImmediate() fires in the check phase, after I/O callbacks. nextTick is for deferred synchronous logic; setImmediate for deferring after I/O.
How do you use multiple CPU cores in Node.js?
Node.js is single-threaded, but the cluster module forks worker processes sharing a port. PM2 cluster mode automates this. For CPU-intensive tasks, use worker_threads. Stateless processes behind a load balancer is the most common production pattern.
Who Is This For?
JavaScript developers building APIs, CLI tools, real-time applications, or server-side pipelines who want a single language across the full stack.