Implement middleware for your APIs to handle authentication and authorization. Walk through what you would check before allowing a request.
Backend Engineer
Go beyond a working API. Think in failures, consistency, and scale.
Choose where to begin
Learn the concepts, build a verifiable project, practice interview scenarios, or run a timed mock loop.
Interview practice
28 scenarios to explore
Your checkout calls a payment provider. How would you handle a request that times out?
Before creating an order, your API checks that a product is in stock. How would you implement the reservation?
Product pages are slow. You add a cache for product information, including prices.
A queue consumer processes order events and grants loyalty points.
An authenticated user requests an invoice by its ID. Which access checks should the API perform?
A frequently used database query is slow. What would you investigate before adding an index?
Limit each account to 100 API requests per minute.
Create an order in a database and publish an order-created event to a broker.
Design pagination for a feed sorted by newest first.
Your API calls three downstream services before returning a response.
Rename a database column used by an API while keeping the service available.
Your system sends writes to a primary database and reads to replicas.
Design an API for uploading large user files over unreliable connections.
Add request logging to make production API failures easier to investigate.
Given an integer array and a target, return the indices of two distinct elements whose sum equals the target, or no result. Explain and implement your approach.
Given customers(id, name) and orders(id, customer_id, status), write SQL to find customers with no completed orders.
Jobs have prerequisite jobs. Return a valid execution order, or report that the dependencies contain a cycle.
Design a URL-shortening service. Explain creation, redirection, storage, and how you would estimate capacity.
A page returns 100 orders and each customer name. Database traces show one orders query followed by 100 customer queries. Diagnose and improve it.
Implement a search that returns the first index of a target in a sorted integer array, or -1 when absent.
Given employees(id, team_id, salary), return everyone in the top three distinct salary levels within each team.
Two transfers update the same pair of accounts in opposite orders. Explain how a deadlock can occur and how to handle it.
Thousands of requests miss the same expensive cached value at once. Design a way to protect the underlying service.
A long-running service uses progressively more memory. How would you distinguish a leak from legitimate load?
A critical proprietary service binary crashed with a segmentation fault in production. The binary was compiled without debug symbols (stripped). How would you determine the root cause from the core dump?
Walk me through the backend project you are most proud of on your resume. Explain the architecture, your personal contribution, and why you built it that way.
Tell me about a time a production issue or complex bug kept failing intermittently and you had no obvious steps to reproduce it.