Interview Horizon

Interview guide

Backend interview practice: contracts, data, and a scored mock

Backend interviews fail on vague APIs and hand-wavy consistency. This session is a rehearsal: write the contract, name the data invariant, then score yourself against a live catalog of questions rather than a generic checklist.

Start from the contract

Write the request and response before the service method. Include auth, idempotency keys, pagination, and the error catalog. If two clients can retry the same POST, say what the server guarantees on the second try.

Version only what you cannot keep compatible. Most teams over-version and under-document. An interviewer would rather hear how you add a field than how you mint v4 in a week.

Data correctness

Pick one invariant: a balance never goes negative, a unique email stays unique, a job is processed at most once. Then name the database tool that enforces it: constraint, transaction, or outbox.

If you rely on “we check in the app,” expect a follow-up about two writers. Application checks are a cache of the real rule, not the rule.

Concurrency you can diagram

Draw two requests hitting the same row. Optimistic locking, SELECT FOR UPDATE, or a queue with a single consumer are different answers. Pick one and defend the latency and failure mode.

Do not claim “eventual consistency” unless you can say what the user sees in the gap and how you reconcile.

Observability in the mock

A good answer includes the log line you would search, the metric that pages, and the trace that connects the gateway to the query. If you cannot name those three, the system is not operable even if the happy path works.

Scored mock (45 minutes)

Prompt: design POST /transfers for moving funds between two wallets owned by the same user. Score yourself 0–2 on each: request validation, idempotency, transaction boundary, conflict errors, logs, and a test that would catch a double debit.

After the mock, practice one live catalog question below instead of opening a new blog post. Depth on one prompt beats a skim of ten.

Catalog source: kind=firestore; database=(default); read=ok

Live catalog practice

These links are loaded from the production catalog at request time. If this section is missing, the I4 persistence contract failed.