Skip to content
Tech Interview Prep

Backend Engineer Interview Prep

Overview

Builds and operates product services, owning APIs, data flows, reliability, and production diagnosis across databases, queues, caches, and downstream dependencies.

Curated: · Written: · Reviewed:

Interview Q&A
101
Practice MCQs
102

The role in one line

Backend engineers own the product services behind the APIs: their contracts, the data flows between them, and how they behave when a dependency fails in production.

The interview loop

Rounds vary by company. This is the usual shape.

RoundWhat it scores
Recruiter screenScope, level, and past ownership
Coding (data structures)Correct solution, complexity, edge cases
SQL and data modellingQuery correctness, schema and index reasoning
API and service designRequirements to contracts, boundaries, idempotency
Failure and reliabilityTimeouts, retries, backpressure, diagnosis
Behavioural (STAR)Ownership, incidents, trade-off decisions

Five must-know areas

  1. API contracts: validation, idempotency keys, pagination, versioning, and object-level authorization. Clients depend on these once shipped.
  2. Transactions and isolation: what commits atomically and which anomalies the chosen isolation level still allows. This is where double writes and lost updates come from.
  3. Messaging and webhooks: at-least-once delivery, idempotent consumers, and where ordering is not guaranteed. Duplicates and reordering are the default, not the exception.
  4. Timeouts, retries, and backpressure: budgets per hop, jittered backoff, bounded queues. Retries multiply load during an outage.
  5. Cache and replica consistency: invalidation on write, read-after-write, and replication lag. Stale reads look like bugs to the user.

Numbers and formulas to have ready

The figures below depend on your system. Say what they depend on before quoting one.

With retries at each layer, the load reaching the bottom layer is the product of attempts per layer:

A=∏i=1kaiA = \prod_{i=1}^{k} a_i

Three layers each making 3 attempts send up to $3^3 = 27$ requests per user action. Set retries at one layer only.

The timeout at the top must cover the work below it plus a margin:

Tclient≥∑iThopi+TmarginT_{client} \ge \sum_{i} T_{hop_i} + T_{margin}

Consumers needed to keep up, using Little's law with arrival rate $\lambda$ and mean service time $s$:

c≥λ⋅sc \ge \lambda \cdot s

Time to drain a backlog of $B$ messages, where consumer rate $\mu$ must exceed producer rate $\lambda$:

tdrain=Bμ−λt_{drain} = \frac{B}{\mu - \lambda}

If $\mu \le \lambda$, the backlog never drains and the fix is more consumers or less work per message.

Reference architecture

Client API gateway: auth, rate limits Order service Primary DB Cache Outbox table Event queue Webhook worker Customer endpoint
  • The outbox row is written in the same transaction as the order, so an event exists if and only if the order commits.
  • The worker retries with exponential backoff and moves messages to a dead-letter queue after a fixed number of attempts.
  • The gateway enforces coarse rate limits; the service enforces per-object authorization.
  • Cache entries are invalidated on write and never trusted after a failed retry.

Strong vs weak answers

QuestionStrong answer sounds likeWeak answer sounds like
Double charge after timeoutThe client sends an Idempotency-Key. I store the key with the response in the same transaction as the charge, and a replay returns the stored result.I'd add a check in the code to avoid duplicates.
Valid JSON, unknown customerI return 422 with a field error on customer_id, since the body is well formed but refers to nothing valid. I'd document that choice.I'd return an error.
Slow dependencyTimeout at 300 ms (hypothetical, set from the dependency's p99), one retry with jitter, and a circuit breaker that opens on a failure-rate threshold.I'd add retries so it recovers.
Consumer lag growingI check whether the bottleneck is per-message work or partition count, then scale consumers up to the partition count and measure the drain rate.I'd add more servers.

Interview tips

  1. Start from requirements: name the client, the expected volume, and the consistency promise before you draw endpoints.
  2. State the invariant each design protects, for example at most one charge per idempotency key.
  3. For every hop, say what the caller sees on timeout and whether a retry is safe.
  4. Attach a source to every number: the dependency's measured p99, your load test, or the vendor's documented limit.
  5. Say what you would not build and why. A scoped refusal reads as judgment.

Last-week checklist:

  • Answer three Top 100 questions aloud in the order requirements, trade-offs, failure modes.
  • Redo the aggregation and isolation-level exercises in the SQL and Transactions concepts.
  • Write the timeout budget for one call chain from a project you have worked on.
  • Prepare one incident in STAR with a measured outcome.
  • Check that your idempotency and pagination answers do not contradict each other.

Feedback on this overview

Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.