Skip to content
Preptima

Backend Engineering interview questions and answers

Language-agnostic service engineering: the protocols, boundaries, and failure handling that sit between a coding round and a full system design round.

30 published across 7 topics.

HTTP & REST

4 questions

Methods and status semantics, caching headers, content negotiation, and HTTP/2 and HTTP/3 differences.

mediumConceptDesignScenario

Two clients open the same record, both edit it, and the second save silently overwrites the first. How would you use ETags to turn that lost update into something the client can see and handle?

Return a strong ETag on GET, require If-Match on writes, and reject a stale token with 412 Precondition Failed so a lost update becomes a visible error rather than silent data loss. What makes it correct is that the comparison and the write must be one atomic operation - an UPDATE guarded by the version in its WHERE clause - because a SELECT then UPDATE reintroduces the race.

4 minmid, senior, staff
mediumConcept

Which status codes and method semantics do you insist on in a code review, how do the caching headers fit together, and is the API you just described REST?

Get the method's safety, idempotency and cacheability right, use the status code intermediaries and clients act on rather than a generic 200 with an error body, pair Cache-Control freshness with ETag or Last-Modified validators, and be honest that most APIs called REST are resource-shaped HTTP without hypermedia.

6 minentry, mid, senior
All 4 in HTTP & REST

Sessions versus tokens, OAuth 2 and OIDC flows, JWT validation pitfalls, and RBAC versus ABAC.

hardScenarioDesign

A maintenance script updates your permissions table and every user in one tenant can suddenly edit everything. What should have stopped that, and how would you have found out?

Permission data is as privileged as the code that reads it, so a bulk write to it needs the same review, staged rollout and reversibility as a deploy. Derive grants from a source of truth rather than stamping them, assert tenant invariants continuously, and know how long a cached decision keeps the mistake alive.

6 minsenior, staff, lead
hardConceptDesign

Would you use server-side sessions or JWTs for authenticating your API, and why?

Default to server-side sessions in an opaque HttpOnly cookie, because revocation is a row delete and the browser cannot read the credential. Choose JWTs only when a resource server must validate without calling the issuer, keep them short-lived, and pin the algorithm, issuer, audience and expiry on every verification.

5 minmid, senior, staff
All 3 in Authentication & Authorisation

Microservices

5 questions

Service boundaries, data ownership, saga and outbox patterns, and when a monolith is the right answer.

hardConceptScenarioDesign

A teammate says a saga can just roll everything back if step four fails. What is wrong with that, and what would you tell them to build instead?

A saga has no rollback. Each step already committed in its own database and was visible to everyone, so you can only run new forward transactions that semantically offset it. Compensations are not atomic, some actions cannot be compensated at all, and compensations themselves fail - so a saga needs idempotent handlers and an ordering rule for irreversible steps.

5 minmid, senior, staff
All 5 in Microservices

Timeouts, retries, idempotency keys, dead-letter queues, and designing for partial failure.

All 3 in Resilience Patterns

GraphQL & gRPC

4 questions

Schema design, N+1 resolution, streaming RPC, and choosing a protocol per consumer.

hardScenarioDesign

You move an internal service to gRPC behind the same load balancer your REST services use, and one pod ends up serving most of the traffic. What is happening, and what do you change?

gRPC multiplexes many calls over one long-lived HTTP/2 connection, so a balancer that distributes connections pins each client to one backend for its lifetime. Balance per request with an HTTP/2-aware proxy or client-side subchannels, and bound connection age so scaling out actually moves traffic.

6 minmid, senior, staff
All 4 in GraphQL & gRPC

Time and ordering, leader election, quorums, idempotence, and classic impossibility results.

All 3 in Distributed Systems Theory

Production situations to diagnose out loud: latency spikes, memory growth, cascading failures, bad deploys.

mediumScenarioCoding

You are dropped into an unfamiliar repository with one failing business rule and an AI assistant that only gives hints. What do you do in the first ten minutes?

Debugging an unfamiliar codebase starts by running the failing test, then reading it as the rule and tracing its call path to the code that computes the wrong value. Let the size of the error narrow the cause, ask the assistant to locate and explain rather than patch, and prove the fix with a test that failed before.

5 minmid, senior
All 8 in Backend Scenarios