Interview questions in Backend Dev, page 7
http.Agent and connection pooling
The agent pools and keeps sockets alive, avoiding repeated TCP and TLS handshakes, controlled by keepAlive and maxSockets.
B-Tree versus Hash indexes
B-Trees keep keys sorted, supporting equality, range, prefix, and ORDER BY; hash indexes give O(1) equality only, no ranges or ordering.
How do you set a custom header and cookie in FastAPI?
Tests FastAPI temporal Response injection and merge behavior. Strong answer: inject Response, set headers via response.headers, cookies via set_cookie, then return the payload normally.
Explain Rust's Ownership and its three compiler-enforced rules
Tests your grasp of Rust's compile-time memory model. A strong answer lists the three ownership rules, links them to stack versus heap, and notes borrow checking enforces them at compile time. Red flag: calling it manual memory management.
Minimal Express Hello World server
Import express, create an app, define app.get on the root sending a response, call app.listen on a port.
Optimizer picks nested loop over hash join
Nested loop wins on few rows, so bad row estimates from stale stats or skewed data trick it; fix by refreshing statistics, adding histograms, rewriting predicates, or ensuring memory for hashing.
Implement a custom exception handler to catch ItemNotFoundError and return 404
Tests FastAPI exception handler registration beyond HTTPException. A strong answer covers creating a custom exception, using app.exception_handler, and returning a JSONResponse with status 404 and a structured body. Red flag: per-route try/except, plain dict.
Why are Rust's borrowing rules stricter than Go's pointers?
This tests compile-time versus runtime safety tradeoffs. A strong answer contrasts Go's aliasing with Rust's rule of one mutable or many immutable references to prevent data races without a GC. A red flag is calling Rust strict without citing race prevention.
Serving static files in Express
App.use with express.static pointing at the public directory, files served relative to that root, often combined with an absolute path.
Indexing a low-cardinality status column
With three values each matches a third of rows, so the optimizer prefers a scan over costly random heap fetches; alternatives include partial indexes on rare values and composite indexes leading with status.
Rust borrow rules versus Go race prevention
Rust's aliasing-XOR-mutability rule plus Send and Sync make races a compile error; Go prevents them at runtime via channels, mutexes and the race detector.
How would you use BackgroundTasks to run work after returning a 201?
What it tests: FastAPI deferred execution and failure modes. A strong answer injects BackgroundTasks, adds the task, returns 201, and notes same-process post-response execution with no persistence. Red flag: Treating it as a distributed queue like Celery.
Query params vs route params in Express
Query string values via req.query.q, named path segments via req.params.id, query is optional, route params are part of the matched pattern.
What is a database page?
A page is a fixed-size block, often 8KB, holding multiple rows; databases read and write whole pages because disk and OS I/O are block-oriented, amortizing seek cost and matching the buffer pool unit.
Access raw request bytes in FastAPI for webhook verification
Tests FastAPI's Starlette integration and stream semantics. Outline: inject Request and await request.body, but the stream is single-use so JSON parsing later fails and docs are lost. Red flag: suggesting a Pydantic model still works after consuming the body.
How does Rust ownership avoid Go GC's non-deterministic pauses?
Tests if you know Rust's compile-time ownership eliminates GC pauses by making deallocation deterministic at scope boundaries. A strong answer contrasts Go's STW with Rust's immediate Drop and zero-cost compile-time checks.
Parsing JSON bodies with express.json
Register express.json via app.use so it reads the request stream and populates req.body before handlers run, place it before routes.
Purpose of the Write-Ahead Log
WAL records changes sequentially and is flushed to disk before commit; the rule is log first, then data pages may lag; on crash the database replays the log to recover committed work.

How do you declare a function as a dependency, and why?
Tests FastAPI dependency injection basics. Answer: create a function, import Depends, and add it to path operation parameters so FastAPI injects it. Purpose: routes declare what they need instead of hard-coding shared logic.
Explain Go escape analysis and Rust ownership for stack vs heap
Tests compiler-driven memory placement. Go escape analysis keeps non-escaping locals on stack, shrinking heap and GC work. Rust ownership lets the compiler pick stack or heap at build time with zero cost.
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