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.
15 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.