Bird
0
0

You need to design a scalable reservation and hold system for a popular event with thousands of simultaneous users. Which approach best ensures no double booking and timely hold expiration?

hard📝 Trade-off Q15 of 15
LLD - Design — Library Management System
You need to design a scalable reservation and hold system for a popular event with thousands of simultaneous users. Which approach best ensures no double booking and timely hold expiration?
AUse distributed locks on resources, store holds with TTL in a distributed cache, and confirm with atomic transactions
BStore all holds in a single database table without expiration, confirm by updating status
CAllow multiple holds per resource and resolve conflicts manually later
DUse client-side timers to expire holds and update server asynchronously
Step-by-Step Solution
Solution:
  1. Step 1: Prevent double booking with distributed locks

    Distributed locks ensure only one user can hold a resource at a time across servers.
  2. Step 2: Use TTL in distributed cache for hold expiration

    TTL automatically expires holds after timeout, preventing indefinite blocking.
  3. Step 3: Confirm holds atomically

    Atomic transactions guarantee reservation creation without race conditions.
  4. Final Answer:

    Use distributed locks on resources, store holds with TTL in a distributed cache, and confirm with atomic transactions -> Option A
  5. Quick Check:

    Distributed locks + TTL + atomic confirm = scalable, safe system [OK]
Quick Trick: Combine distributed locks, TTL cache, and atomic confirm for scale [OK]
Common Mistakes:
MISTAKES
  • Ignoring concurrency causing double booking
  • Relying on client-side expiration only
  • Not using atomic operations for confirmation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes