Design a reservation API with temporary holds
PremiumAPI designMedium
- Temporary holds
- TTL expiry
- Double booking
Quick answer
This API design interview question asks you to design a reservation API with temporary holds. Aim for a design that exposes a clear, consistent and safe interface, then explain the resources, requests, responses and error handling. Interviewers want to see how you name resources, version the interface and handle failure cases.
The problem
Design a reservation API with temporary holds for a ticketing platform like Ticketmaster: picked seats leave the market while the fan pays and come back if the fan walks away. The hard parts are never double booking a seat, expiring holds on time and staying fair during an on-sale rush.
Design the HTTP API for availability, temporary holds, confirmation into a booking, release, expiry and the booking itself. Make the contract clear enough that a partner could build a checkout against it without reading the server code.
What must a reservation API with temporary holds do?
- Hold: Hold 1 to 8 specific seats (or N seats in a section, best available) for 8 minutes; the response states the expiry time.
- Confirm: Turn a hold into a booking with a payment reference; the booking keeps the seats permanently.
How well must it do it?
- No double booking: Two holds never contain the same seat at the same time, under any load.
- Latency: Hold creation under 200 ms at p95; availability under 100 ms.
What scale should you design for?
Use these numbers in your estimates.
The scale numbers unlock with this questionUnlock
Key concepts
- Temporary holds
- TTL expiry
- Double booking
- Idempotency keys
- Inventory contention
- State machine
How you’ll practise
- Use cases
- Resources
- Endpoints
- Errors, auth and limits
- Versioning
- Wrap-up
Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.
What do interviewers look for?
In any API design round.
- Starts from the clients and the use cases
- Names resources and operations consistently
- Defines request and response shapes and status codes
- Covers authentication, rate limits and idempotency
- Plans pagination, filtering and versioning
- Explains how clients learn about and recover from errors
Questions people ask about this interview question
- Which design type is this question?
- It is an API design question. You design a reservation API with temporary holds and explain your choices the way you would in an interview.
- Is this question asked at entry level?
- It is marked Medium. Entry-level engineers can practise it, but it expects you to reason about requirements and trade-offs, not only list components.
- What should I cover first?
- Start with the clients, the main use cases and the resources they need. Agree on scope with the interviewer before you design anything.
- Can I practise it for free?
- It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.
Related questions
Updated · Written by the SevyDevy team