Intermediate to senior

Backend Interview Prep

Fourteen chapters on HTTP and API design, SQL, indexing and transactions, NoSQL, authentication, caching, concurrency, messaging, resilience, deployment and observability, with tested SQL and Python.

Chapter 1 of 14Foundations · How Backend Interviews Work

How Backend Interviews Work

Backend interviews test whether you can build services that are correct, secure, fast enough and operable. Unlike pure algorithm rounds, they mix coding with databases, APIs, concurrency, failure handling and system thinking. This chapter maps the rounds, lists what each one looks for, and gives a plan for the rest of the track.

1. The rounds you will meet

RoundWhat it checksTypical prompts
Codingdata structures, clean code, edge casesthe DSA track; plus practical tasks such as parsing logs or building an in-memory store
API designresources, methods, status codes, versioning, pagination, errors, idempotency"Design the API for a booking service."
DatabasesSQL, schema design, indexes, transactions, isolation, query plans"Write a query for the top three customers per city." "Why is this query slow?"
Concurrencythreads, locks, race conditions, async I/O, worker pools"Fix this race condition.", "Implement a thread-safe counter or rate limiter."
Distributed systems basicsconsistency, replication, partitioning, retries, queues"What happens if the message is delivered twice?"
System designwhole-system architecture and trade-offsthe System Design track
Securityauthentication, authorisation, injection, secrets"How do you store passwords?"
Operationsdeployment, monitoring, debugging production incidents"The API is slow in production. What do you check?"
Behaviouralownership, incident stories, collaborationthe HR track

Which languages? Interviewers usually accept whichever you know best (Java, Go, Node.js/TypeScript, Python, C#). The concepts in this track are language-neutral; examples use SQL and Python because they are easy to run and check, with notes where Java, Go or Node differ.

2. What interviewers look for

  1. Correctness first: handles edge cases, invalid input, partial failure.
  2. Data integrity: transactions, constraints, idempotency.
  3. Trade-off reasoning: SQL or NoSQL, cache or not, sync or async, and why.
  4. Operational thinking: logs, metrics, timeouts, retries, deploys, rollbacks.
  5. Security instincts: never trust input, least privilege, safe defaults.
  6. Scale awareness without over-engineering: estimate load, find the bottleneck, add complexity only when justified.
  7. Clear communication: state assumptions, draw simple diagrams, explain failure modes.

3. The map of this track

ChapterUse it for
HTTP and REST API designmethods, status codes, idempotency, pagination, versioning, errors
SQL fundamentalsjoins, aggregation, window functions, query patterns
Indexes, transactions and isolationwhy queries are slow; ACID; anomalies and isolation levels
Schema design and NoSQLnormalisation, modelling, choosing a datastore
Authentication and authorisationpasswords, sessions, tokens, OAuth, RBAC
Cachingstrategies, invalidation, stampedes
Concurrencyraces, locks, async I/O, thread-safe design
Messaging and event-driven designqueues, delivery guarantees, outbox, sagas
Resilience patternstimeouts, retries, circuit breakers, rate limiting
Microservices and distributed basicsboundaries, consistency, CAP, service communication
Testing, deployment and CI/CDtest strategy, releases, migrations
Observability and performancelogs, metrics, traces, finding bottlenecks
Backend coding patternsthe practical coding questions that recur

4. A request's journey

A useful mental model for many questions: follow a request through the stack and ask what can fail at each step.

<!--fig:request-->
Clientbrowser, app Gateway / LBTLS, auth, limits Servicevalidate, authorise Cachehit: answer here Databaseindexes, transactions Queueevents, side effects Workersemail, indexing For each hop ask: what is the timeout, is a retry safe, and how would I notice it failing? One request, left to right. Metrics, logs and trace ids are recorded at every hop. Figure 1. A request's journey through a typical backend.
  1. Client sends a request (DNS, TLS).
  2. Load balancer / gateway routes, terminates TLS, rate-limits, authenticates.
  3. Service validates input, authorises, runs business logic.
  4. Cache may answer; on a miss the service reads the database.
  5. Database executes the query, with locks, indexes and transactions.
  6. Side effects: publish an event to a queue, call another service.
  7. Response with the right status code and body; metrics and logs written along the way.

For each step, practise answering: what is the latency budget, what happens on timeout, is it safe to retry, and how would I notice it failing?

5. A preparation plan

WeeksFocus
1HTTP and REST, SQL fundamentals (do 30 SQL problems)
2Indexes, transactions, schema design; read query plans
3Authentication, caching, concurrency
4Messaging, resilience, microservices basics
5Testing, deployment, observability; two system designs
6Mock interviews; build one small service end to end (API, database, tests, Dockerfile)

Building a small real service teaches more than reading: add pagination, auth, a migration, a background job and a metrics endpoint.

6. How to answer design-flavoured questions

  1. Clarify requirements, scale and consistency needs.
  2. Sketch the main components and the data model.
  3. Walk the critical path (the happy path), then the failure paths.
  4. Name the trade-offs and the alternatives you rejected.
  5. Mention operations: monitoring, deployment, migration, rollback.

7. Common mistakes

  • Jumping to microservices, Kafka or Kubernetes for a small problem.
  • Ignoring failure: no timeouts, no retries or retries without idempotency.
  • Treating the database as a black box: no indexes, N+1 queries, unbounded results.
  • Trusting input and building SQL by string concatenation.
  • Skipping the data model.
  • Not saying what you would measure.
  • Memorised buzzwords without the ability to explain them.

8. Practice questions

  1. Trace what happens when a user places an order, from the browser to the database and back.
  2. How do you decide between SQL and NoSQL?
  3. A request occasionally times out. How do you investigate?
  4. How would you make an endpoint safe to retry?
  5. What would you check first if the database CPU is at 100%?
  6. How do you roll out a schema change with no downtime?
Header Logo