Design a Hotel Reservation System: Junior, Senior, and Staff Answers
When you hear hotel reservation system, the interviewer wants to see how you balance three things: handling a burst of traffic, keeping the booking data consistent, and thinking about the day-to-day operation of a live service. The problem is small enough to sketch on a whiteboard, but big enough to expose trade-offs in storage, caching, and messaging.
What the interviewer is testing
- Scalability – can you design for a few thousand rooms and around a hundred thousand searches per day?
- Consistency – how do you prevent double-booking when many users request the same room?
- Operational awareness – monitoring, cost, and failure recovery.
- Communication – you must explain each component, why you chose it, and what you would monitor.
Core requirements and driving numbers
| Requirement | Typical value (hedged) |
|---|---|
| Peak search traffic | ~100 k queries per day ≈ 1.2 queries/sec |
| Booking requests | ~10 k bookings per day ≈ 0.12 requests/sec |
| Rooms per hotel | 100–500, assume 200 average |
| Concurrent users during a promotion | 10 k simultaneous sessions |
| Availability latency | <200 ms for search, <500 ms for booking |
These numbers drive two main design dimensions: read-heavy search versus write-heavy booking, and the need to keep the room-availability state consistent across many parallel requests.
Request path, one hop at a time
- Client → API Gateway – HTTPS entry point. Using Amazon API Gateway gives you throttling, auth, and a stable endpoint.
- API Gateway → Application Layer (ECS/Fargate) – Stateless services written in your language of choice. They parse the request, perform validation, and orchestrate downstream calls.
- Search flow – The service reads room data from ElastiCache (Redis) for fast look-ups, falling back to DynamoDB if the cache misses. Results are filtered and returned.
- Booking flow – The service writes a reservation record to Aurora PostgreSQL inside a transaction that also updates a room-availability table. To avoid double-booking, we lock the row (or use a conditional write in DynamoDB) before committing.
- Post-booking – An event is placed on SQS (or Kafka on MSK for high-throughput pipelines). Downstream workers update analytics, send confirmation emails via SES, and invalidate the cache entry.
- Static assets – Hotel images and policy PDFs live in S3, served through CloudFront for low latency worldwide.
Data model snapshot
- Hotel (hotel_id, name, location, rating)
- Room (room_id, hotel_id, type, price, capacity)
- Reservation (reservation_id, room_id, user_id, check_in, check_out, status)
- Availability (room_id, date, is_available) – kept in a fast store (DynamoDB or Redis) for the booking window.
Key architectural choice
We pick DynamoDB for the availability table because it gives single-digit millisecond reads, automatic scaling, and conditional writes that let us enforce "no double-booking" without a heavyweight lock. Aurora stores the authoritative reservation records, supporting complex queries for reporting and admin tools.
We chose DynamoDB over a relational lock table because a lock table would require explicit transaction handling and could become a bottleneck under burst traffic. The trade-off is eventual consistency for reporting, which we mitigate by reading from Aurora for admin views.
What a complete junior answer covers
- Lists functional requirements (search, book, cancel) and non-functional targets (latency, scalability).
- Draws a simple three-tier diagram: client → web server → database.
- Mentions a cache (Redis) for search speed.
- Explains basic flow for search and booking without deep consistency details.
- Touches on scaling the web tier with auto-scaling groups.
- Identifies a single point of failure (the database) but does not propose mitigation.
What a senior answer adds
- Concurrency control – explains conditional writes in DynamoDB or row-level locking in Aurora to prevent double-booking.
- Async processing – uses SQS/Kafka to decouple email notifications and analytics from the critical booking path.
- Cache invalidation – describes a write-through or write-behind strategy to keep Redis consistent.
- Monitoring – proposes CloudWatch metrics for request latency, cache hit ratio, and DB connection pool usage.
- Resilience – adds multiple AZ deployment for the application tier and read replicas for Aurora.
- Cost awareness – notes on-demand vs. reserved capacity for DynamoDB and Aurora.
What a staff answer adds
- Failure modes – details how to handle DB outage (fallback to read-only mode), cache loss (warm-up from DynamoDB), and network partitions. Includes a circuit-breaker pattern.
- Operational runbooks – outlines alerts for high error rates, automated scaling policies, and a daily backup strategy for Aurora and DynamoDB.
- Cost breakdown – rough estimate of monthly spend (e.g., DynamoDB reads/writes, Aurora instance hours, S3 storage) with hedged numbers.
- Trade-off defense – defends using DynamoDB for availability despite eventual consistency, citing the need for single-digit millisecond latency and the ability to use conditional writes.
- Performance testing – suggests load-testing with a tool like k6, simulating the peak 10 k concurrent users during a promotion.
- Security – mentions IAM roles, VPC isolation, and encryption at rest for all data stores.
Common mistakes that sink this question
| Mistake | Why it hurts |
|---|---|
| Ignoring consistency | Leads to double-booking, a fatal user-experience bug. |
| Over-engineering with micro-services | Adds latency and operational complexity without clear benefit at junior level. |
| Forgetting cache invalidation | Stale room availability shows wrong results, causing cancellations. |
| No scaling plan | Interviewer expects you to discuss auto-scaling; missing it looks like a lack of production experience. |
| Skipping cost discussion | At senior and staff levels, interviewers probe for cost-effective design. |
Level comparison table
| Aspect | Junior | Senior | Staff |
|---|---|---|---|
| Architecture depth | 3-tier (client, app, DB) | Adds cache, async queue, multi-AZ | Adds failure handling, ops runbooks, cost analysis |
| Consistency handling | Basic DB writes | Conditional writes, lock strategy | Detailed idempotency, fallback paths |
| Scaling | Auto-scale app tier | Auto-scale cache, DB read replicas | Capacity planning, cost-optimized instance types |
| Monitoring | Simple health check | CloudWatch metrics, alerts | Full SLO/SLA dashboard, incident response |
| Operational concerns | Mentioned lightly | Backup, replication | Runbooks, circuit-breaker, security policies |
How to practice this
- Study the worked design for a hotel reservation system in the System Design AI library. Observe how each component is annotated with notes on what to say and what can go wrong.
- Write your own answer on the canvas: start with the request path, then add the data model, and finally layer in consistency and operational details.
- Use the practice brief rubric to self-evaluate. Focus on the gaps between junior, senior, and staff expectations, and iterate until the staff-level checklist is satisfied.
Questions people ask
What is the main challenge in designing a hotel reservation system?
Preventing double-booking while serving a high volume of read-heavy search queries. The system must keep room availability consistent across many parallel requests.
Why use DynamoDB for room availability instead of a relational lock table?
DynamoDB provides millisecond-scale reads and conditional writes that let you enforce uniqueness without a heavyweight lock, scaling automatically with traffic spikes.
How do you handle cache invalidation after a booking?
Publish an event to SQS (or Kafka) after a successful transaction, and have a worker update or evict the relevant Redis key so subsequent searches see the new state.
What operational metrics should you monitor for this service?
Track request latency, cache hit ratio, DB connection pool usage, error rates, and queue depth. Set alerts on latency spikes and error thresholds.