Backend Engineer · interview questions

Backend Engineer interview questions: scenario

From the role's core and recommended topics, most asked first. Filter by the kind of answer the question wants.

API Design Core 1

  1. An API endpoint that was fast is now taking seconds under load. Walk through your investigation.

Caching Core 4

  1. How do you keep cache and database consistent on writes?
  2. Your Redis cluster has one shard at 100% CPU while others idle. What's likely and how do you fix it?
  3. How do you keep in-process L1 caches on many pods consistent?
  4. After adding a Redis cache, users sometimes see stale or wrong data. How do you investigate and fix it?

Databases & Transactions Core 1

  1. Most asked How do you keep data consistent across services without distributed transactions?

Testing Core 4

  1. Most asked Your end-to-end test suite is flaky and takes an hour. How do you fix it?
  2. What should end-to-end tests cover, and how do you keep them stable?
  3. A critical bug reached production even though all tests passed. What do you do?
  4. How do you keep a large test suite fast?

Database Concurrency & Scaling Recommended 7

  1. Most asked Two customers buy the last item at the same moment and both orders are confirmed. What happened, and how do you prevent it?
  2. Most asked After a deploy, logs show hundreds of 'deadlock detected' errors per hour on checkout. Walk through how you'd investigate.
  3. Most asked Your service throws 'connection pool exhausted' errors but database CPU is only 20%. What's going on?
  4. A 20 ms ALTER TABLE caused a multi-minute outage. Explain and prevent it.
  5. An API's deep pages are slow and a sync job sees duplicate and missing rows. What would you change?
  6. You have 14 services autoscaling against one Postgres and hit 'too many clients'. What's the long-term fix?
  7. Your read replicas lag 40 seconds during a nightly import. What do you do?

Performance & Scalability Recommended 1

  1. Why does connection reuse (keep-alive, pooling) matter for performance?

Logging & Observability Recommended 2

  1. Most asked Walk through how you would investigate a sudden latency spike in production.
  2. How do you keep log context (user, request) in async or multi-threaded code?

Web Framework Internals Recommended 5

  1. What does PHP-FPM's capacity depend on, and why can it fail with low CPU usage?
  2. Scenario: users get 504 errors but your application logs show those requests succeeding. What is happening?
  3. Scenario: after moving to an async framework, every endpoint becomes slow whenever one partner API is slow. Why?
  4. Scenario: an API returns 500 instead of 401 for expired tokens. In which frameworks have you seen this and why?
  5. Scenario: one new endpoint leaked other customers' data while forty others were fine. How do you prevent this class of bug?

Design Patterns Recommended 8

  1. Most asked Scenario: your checkout supports card and PayPal, and the business adds a new payment provider every quarter. How would you design it?
  2. Most asked Scenario: when an order is placed, several systems (email, inventory, analytics, loyalty) must react, and more will be added. How do you design it?
  3. Scenario: you need undo/redo in a drawing or text editor. Which pattern would you use?
  4. Scenario: a third-party SDK you must use has a completely different interface from the rest of your code. What do you do?
  5. Scenario: a class has a constructor with ten parameters, many optional. How would you improve it?
  6. Scenario: you need to add caching and logging to an existing service without modifying it. How?
  7. Scenario: every method of an `Order` class starts with a switch on `status`. How would you refactor it?
  8. Scenario: product categories contain products and subcategories to any depth, and you need totals per category. Which pattern fits?

Docker Recommended 1

  1. Why might a container work on your laptop but fail on a server or in CI?

FAANG / Big Tech Recommended 1

  1. How do you debug intermittent production latency spikes?

Was this page helpful?

Report a mistake