Design: Reservation and Hold System
Includes reservation and hold management, timeout handling, user notifications. Excludes payment processing and inventory restocking.
Functional Requirements
Non-Functional Requirements
Jump into concepts and practice - no test required
Client | v API Gateway | v Reservation & Hold Service <--> Cache (Redis) | v Database (PostgreSQL) | v Scheduler / Background Worker | v Notification Service
if hold.exists(hold_id) and not hold.is_expired(hold_id):
reservation.create(hold.resource)
hold.remove(hold_id)
return "Confirmed"
else:
return "Failed"
What will be the output if the hold has expired?for hold in holds:
if hold.expiration_time < current_time:
holds.remove(hold)
What is the main issue with this code?