tezvyn:

⚙️Backend Dev

Backend engineering, APIs, and databases

1086 bites

More in Backend Dev — page 8

Node.js & Express84 sec read

Running independent requests with Promise.all and race

WHAT IT TESTS: concurrent Promise combinators. OUTLINE: start all requests then await Promise.all to get all results or fail fast on first rejection; use Promise.race when only the fastest settled result matters.

Node.js & Express80 sec read

Output order of sync, microtask, and macrotask

WHAT IT TESTS: microtask vs macrotask priority. OUTLINE: C runs first synchronously, then B drains from the microtask queue, then A from the macrotask queue. RED FLAG: claiming setTimeout(0) beats the Promise, or that order is random.

Node.js & Express81 sec read

The three states of a JavaScript Promise

WHAT IT TESTS: fundamentals of Promise lifecycle. OUTLINE: pending, fulfilled, rejected; settle is one-way and final; create with the executor calling resolve or reject, consume with then and catch.

Node.js & Express88 sec read

Monorepo workspaces vs private npm packages

WHAT IT TESTS: tradeoffs of code-sharing strategies. OUTLINE: workspaces give atomic cross-service changes and instant local linking but couple release cadence; private packages give versioned isolation but add publish overhead and version drift.

Node.js & Express86 sec read

Diamond dependencies and nested node_modules

WHAT IT TESTS: understanding npm's nested install layout. OUTLINE: npm hoists one version to the top and nests the conflicting version under the dependent package; both coexist on disk.

Node.js & Express81 sec read

Circular dependencies in CommonJS modules

WHAT IT TESTS: deep understanding of CommonJS loading. OUTLINE: when A requires B which requires A, the cache returns A's partial exports; fields defined later are undefined at that moment.

Node.js & Express74 sec read

SemVer and the caret vs tilde range operators

WHAT IT TESTS: understanding version ranges. OUTLINE: MAJOR.MINOR.PATCH signals breaking/feature/fix; caret allows minor and patch updates, tilde allows only patch; use tilde for tighter control.

Node.js & Express84 sec read

Layered structure for a scalable Express API

WHAT IT TESTS: separation of concerns and testability. OUTLINE: routes map URLs, controllers handle HTTP, services hold business logic, data layer talks to the DB; keep each layer ignorant of HTTP except controllers.

Node.js & Express82 sec read

Choosing between CommonJS and ES Modules

WHAT IT TESTS: knowing the two module systems and their config. OUTLINE: ESM is the standard with static import/export and top-level await; set type to module; CJS uses require and module.exports and is synchronous.

Node.js & Express76 sec read

Why package-lock.json must be committed

WHAT IT TESTS: understanding reproducible installs. OUTLINE: lockfile pins exact versions of the whole dependency tree including transitive deps; guarantees identical installs across machines and CI.

Node.js & Express76 sec read

Resolving core vs relative module specifiers

WHAT IT TESTS: knowledge of module resolution rules. OUTLINE: 'fs' is a built-in core module loaded by name with top priority; './my-file.js' is a relative path resolved from the current file.

Node.js & Express70 sec read

dependencies vs devDependencies in package.json

WHAT IT TESTS: understanding runtime versus build/test tooling. OUTLINE: dependencies ship and run in production; devDependencies are only for development; omitted with npm install --production.

Node.js & Express86 sec read

Offloading CPU-bound work with Worker Threads

WHAT IT TESTS: knowing the single thread blocks on CPU work. OUTLINE: synchronous CPU work freezes the loop and all requests; offload to a Worker, communicate via messages or SharedArrayBuffer, use a pool. RED FLAG: suggesting async I/O fixes CPU blocking.

Node.js & Express71 sec read

nextTick vs setImmediate vs setTimeout(fn, 0)

WHAT IT TESTS: precise ordering of deferral mechanisms. OUTLINE: nextTick is a microtask that drains before the loop continues; setImmediate runs in check; setTimeout(0) in timers.

Node.js & Express84 sec read

Order of the Node.js event loop phases

WHAT IT TESTS: understanding of libuv's loop, not just async vibes. OUTLINE: timers, pending callbacks, poll, check, close phases in order; I/O completion runs in poll. RED FLAG: claiming Node is single-phase or fully multithreaded.

Node.js & Express2 min read

The WebSocket Protocol

WebSocket (RFC 6455) is a protocol providing full-duplex, persistent communication over a single TCP connection. It begins as an HTTP request that upgrades, then both client and server can send messages anytime, enabling real-time apps without HTTP's…

Databases & Architecture81 sec read

Diagnosing high Redis eviction and cache misses

WHAT IT TESTS: practical Redis memory debugging. OUTLINE: use INFO memory and stats to confirm pressure, check fragmentation ratio, pick LFU over LRU for skewed access, set sane TTLs. RED FLAG: just raising maxmemory without finding the cause.

Databases & Architecture81 sec read

Modeling IoT data with tags and fields

WHAT IT TESTS: time-series schema design. OUTLINE: tags are indexed identifying metadata, fields are unindexed measured values, and tag cardinality drives memory. RED FLAG: putting high-cardinality unique IDs in tags and exploding the index.

Databases & Architecture89 sec read

Problems the Lakehouse architecture solves

WHAT IT TESTS: knowing the gaps in raw data lakes. OUTLINE: lakehouse adds ACID transactions, schema enforcement, and time travel on cheap object storage. RED FLAG: describing it as merely a faster query engine rather than a table format.

Databases & Architecture82 sec read

Why choose Kafka over a REST endpoint for ingestion

WHAT IT TESTS: understanding async decoupling and buffering. OUTLINE: Kafka buffers spikes, decouples producers from consumers, replays and fans out durably. RED FLAG: thinking a synchronous REST call gives the same back-pressure and durability.