Skip to content
tezvyn:

Node.js & Express

Node.js, Express, Fastify, NestJS, Bun, Deno

71 bites

Test yourself: Top 30 advanced Node.js & Express interview questionsMultiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Advanced everything in Node.js & Express, page 4

advanced2 min read

Node's zlib Module: Trading CPU for Bandwidth

Node's zlib module trades CPU cycles for network bandwidth by shrinking data with algorithms like Gzip and Brotli. Use it to compress large API responses or files before sending them. The main footgun: never use synchronous ...Sync methods in a server.

advanced2 min read

Hashing Data with Node.js's `crypto` Module

Hashing creates a unique, fixed-size fingerprint of data. It's a one-way process used to verify data integrity or store passwords securely without saving the plain text. The footgun is using weak algorithms like MD5 or SHA1 for security-sensitive tasks.

Top-Level Await: `await` Without an `async` Function
advanced2 min read

Top-Level Await: `await` Without an `async` Function

Top-level await lets you use await directly in an ES module, no async function needed. Use it to initialize resources like database connections on startup. The footgun: the entire module's execution blocks until the promise resolves, delaying startup.

Promise.any(): Get the Fastest Successful Result
advanced2 min read

Promise.any(): Get the Fastest Successful Result

Promise.any() is a race where only finishers count. It returns the value of the first promise to succeed, ignoring any that fail. Use it to query redundant endpoints and take the first successful response.

Promise.allSettled(): Never Fail a Batch of Promises
advanced2 min read

Promise.allSettled(): Never Fail a Batch of Promises

Promise.allSettled() waits for every promise in a set to finish, success or fail, without short-circuiting. Use it for independent tasks, like multiple API calls, where you need the outcome of each.

Promise.race(): First Promise to Settle Wins
advanced2 min read

Promise.race(): First Promise to Settle Wins

Promise.race() returns a promise that mirrors the outcome of the first promise in a set to finish—the winner takes all, whether it resolves or rejects. Use it to set a timeout on a network request.

NPM Scopes: Namespacing Packages to Avoid Collisions
advanced2 min read

NPM Scopes: Namespacing Packages to Avoid Collisions

NPM scopes act like a personal folder for your packages, using the @scope/package format to avoid name collisions. They are essential for publishing private packages for your team or grouping related public ones.

advanced2 min read

Node.js Circular Dependencies: The Unfinished Export

When module A requires B, and B requires A, Node.js avoids an infinite loop by returning an unfinished version of one module's exports. This happens in complex apps with tightly coupled modules. The code doesn't crash; it fails later with a TypeError.

advanced2 min read

Node.js Cluster: Scaling on a Single Machine

The cluster module turns a single-threaded Node.js app into a multi-process server that uses all CPU cores. It's ideal for scaling network applications on one machine by sharing a single port.

advanced2 min read

Worker Threads: True Parallelism in Node.js

Worker threads give Node.js a separate brain for heavy lifting, letting you run CPU-intensive code without blocking the main event loop. Use them for tasks like image processing, not I/O. The footgun is assuming memory is shared; it isn't.

Libuv: The Engine Behind Node.js Async I/O
advanced2 min read

Libuv: The Engine Behind Node.js Async I/O

Libuv is the C library that powers Node.js's non-blocking I/O. It translates JavaScript's event loop into high-performance async calls for the host OS. The footgun is thinking this makes Node multi-threaded; it uses an event loop and a thread pool.

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles