Skip to content
tezvyn:

⚙️Backend Dev

Backend engineering, APIs, and databases

280 bites

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

Advanced everything in Backend Dev, page 10

advanced2 min read

E2E Testing: The Final Check, Not The Whole Strategy

E2E testing is a dress rehearsal for your app, simulating a full user journey. Use it sparingly for critical flows like checkout, as it tests all services together. The footgun is over-reliance: they are slow, brittle, and hard to debug.

advanced2 min read

Node.js Uncaught Exceptions: Clean Up, Don't Continue

An uncaught exception is a fire alarm for your Node.js app, signaling an unknown state. Use the process.on('uncaughtException') hook for last-resort synchronous cleanup before exiting, not to resume normal operation.

advanced2 min read

JWT Storage: Cookies (CSRF Risk) vs. Local Storage (XSS Risk)

Storing JWTs means choosing your risk: Cross-Site Request Forgery (CSRF) with cookies, or Cross-Site Scripting (XSS) with local storage. While local storage is simpler, HttpOnly cookies are generally safer as they can't be read by client-side scripts.

advanced2 min read

CSRF Tokens: Preventing Unwanted State Changes on Your Behalf

CSRF protection prevents a malicious site from forcing a user's browser to submit unwanted requests to your app. It adds a unique token to forms that the server validates. The footgun is failing to protect all state-changing endpoints, not just POST forms.

advanced2 min read

Passport.js: The Generic OAuth2 Strategy

Passport's generic OAuth2 strategy is a template for social logins, not a plug-and-play solution. Use it to integrate a custom OAuth2 provider. The footgun is using it when a provider-specific strategy (like passport-github2) exists, which handles quirks for…

advanced2 min read

OAuth 2.0: Delegated Authorization, Not Authentication

Think of OAuth 2.0 as a valet key for your data. It lets a third-party app access specific resources on your behalf without you sharing your password. It's used for "Log in with Google" or letting an app access your photos.

advanced2 min read

Sequelize Scopes: Reusable Query Shortcuts

Sequelize scopes are named shortcuts for common query conditions, letting you define where or include clauses once and reuse them. Use them to keep code DRY, like an active scope. The footgun: a defaultScope is always on unless you call .unscoped().

Mongoose Population: Linking Documents Across Collections
advanced2 min read

Mongoose Population: Linking Documents Across Collections

Mongoose's populate() acts like a client-side JOIN, replacing document IDs with actual documents from other collections. It's ideal for linking related data, like a blog post's author.

advanced2 min read

Sequelize Transactions: All-or-Nothing Database Writes

A Sequelize transaction is a safety wrapper for database queries, ensuring they all succeed or none do. Use it for multi-step operations like creating a user and profile.

advanced2 min read

HATEOAS: Let Your API Tell You What's Next

HATEOAS makes an API self-discoverable, like a website where you click links instead of guessing URLs. The server's response includes links for the next possible actions, decoupling the client from hardcoded endpoints.

advanced2 min read

API Rate Limiting: Protecting Your Express Endpoints

Rate limiting acts as a bouncer for your API, preventing any single user from overwhelming it. It's crucial for public APIs and sensitive endpoints like password resets to block abuse. The default in-memory store won't work across multiple server instances.

Idempotency in REST APIs: Safe to Retry?
advanced2 min read

Idempotency in REST APIs: Safe to Retry?

An idempotent API request means sending it once or 100 times has the same effect on the server's state. GET, PUT, and DELETE are idempotent, making them safe to retry. POST is not, so retrying can create duplicates.

Express Error Middleware: Your App's Safety Net
advanced2 min read

Express Error Middleware: Your App's Safety Net

Express error middleware is a safety net that intercepts unhandled errors, preventing crashes. It's used to centralize logging and format consistent error responses. The biggest footgun is placement: it must be defined *after* all other routes and middleware.

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.

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