Intermediate concepts in Backend Dev, page 4
go.mod: Root of Go Module Identity
A go.mod file anchors a Go module, declaring its canonical path and dependencies to turn a directory into a versioned unit. Every project needs one at its root, and the path dictates how others import your packages.
FastAPI: Set Cookies Without Returning a Response Object
Inject a Response object into your endpoint to set cookies without manually building the whole response. Use this for session tokens while still returning data like a dict.
WHATWG URL API: Safely Parse URLs, Not Strings
Treat URLs as structured objects, not messy strings. The WHATWG URL API parses a URL into components like protocol and path, just like JSON.parse. Use it for incoming requests or outgoing API calls. The footgun is using the legacy url.parse().
Cargo.toml: Rust's Project Recipe
Cargo.toml is your Rust project's recipe, telling the compiler what to build and what dependencies it needs. It defines metadata, production dependencies, and dev-only dependencies for testing.
Rust's Module-to-Filesystem Mapping
Rust's module system maps directly to your file system. A mod foo; statement tells the compiler to look for foo.rs or foo/mod.rs. This is how you organize any multi-file Rust project.

Heap File Organization: Fast Writes, Slow Reads
Heap file organization is like tossing records into a box in no particular order. It's great for bulk-loading data quickly, but searching requires a full table scan. The footgun is using it for frequently queried tables, which kills performance.

Slotted Page Structure: Stable Pointers on Disk
A slotted page organizes data by growing records from the end of the page and pointers from the beginning. This allows databases to handle variable-sized records without costly reshuffling, keeping pointers stable.

Database Checkpoints: Faster Recovery After a Crash
A database checkpoint creates a known good point for faster crash recovery. Instead of writing every change to disk, it periodically flushes modified data from memory, reducing the amount of log data to process.
FastAPI Global Dependencies: DRY Your API Logic
A FastAPI global dependency is like a bouncer for your entire API, running a check on every request. Use it for universal concerns like API key validation. The footgun is applying logic that should only affect a subset of routes, making your API rigid.
Page Replacement Algorithms: Evicting Data from Memory
A page replacement algorithm is a bouncer for your RAM. When memory is full and a new page is needed, it decides which existing page to evict to disk. This is crucial in virtual memory systems.

Express Middleware: The Chain of Command for Requests
Express middleware is a chain of functions a request passes through. Each function can inspect, modify, or stop the request, useful for logging, auth, or body parsing.

express.Router: Group Routes into Modular Files
express.Router is a mini-app for your routes. It lets you group related endpoints (e.g., all /users/... routes) into their own file, keeping your main app.js clean. The footgun is forgetting to mount the router in the main app with app.use().
Rust's `Drop` Trait: Automatic Resource Cleanup
Rust's Drop trait provides automatic, deterministic cleanup, like a destructor. It's used to release external resources like file handles or network sockets when a value goes out of scope. The key footgun: you cannot implement Drop on a Copy type.
RAII in Rust: Automatic Cleanup via Scope
RAII ties a resource's lifetime to its owner's scope. When the owner variable is dropped, Rust automatically cleans up the resource, preventing leaks. This applies to heap memory, file handles, and locks. The footgun: cleanup is deterministic, not like a GC.
Rust's Lifetime Elision: When You Can Skip 'a
Lifetime elision lets you omit explicit lifetimes ('a) in function signatures. The compiler infers them from common patterns, like a function taking one reference and returning one.

Scaffold an Express App with `express-generator`
The express-generator CLI is a blueprint for new Express apps, instantly creating a standard folder structure and boilerplate files. Use it to skip tedious setup of routes and views.

GC vs. Ownership: Two Paths to Memory Safety
Rust's ownership model provides memory safety at compile-time, aiming for C++-level performance without a garbage collector. This makes it ideal for systems programming where resource control is key. The footgun is assuming all "safe" languages are equal.
Hash Join: Faster Database Joins with Hash Tables
A hash join speeds up database joins by building an in-memory lookup table (a hash table) for the smaller table, then streaming the larger one past it to find matches. It's ideal for large, unsorted equijoins.
Sort-Merge Join: The 'Line Up and Walk' Join
A sort-merge join is like merging two sorted lines of people. It's efficient when tables are already sorted on the join key or memory is tight. The footgun: if data isn't pre-sorted, the initial sort can make it slower than other join methods.

External Merge Sort: Sorting Data Bigger Than RAM
External merge sort handles datasets too big for RAM. It sorts the data in memory-sized chunks, writes them to disk, then merges the sorted chunks back together. It's crucial for database indexing, but its speed is limited by disk I/O, not CPU.
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