Bird
0
0

You are designing a test booking system that must handle thousands of users booking slots concurrently. Which design approach best ensures availability and prevents double bookings?

hard📝 Trade-off Q15 of 15
LLD - Design — Hotel Booking System
You are designing a test booking system that must handle thousands of users booking slots concurrently. Which design approach best ensures availability and prevents double bookings?
AShow all slots as available and accept bookings first come, first served
BAllow users to book without checks and fix conflicts later manually
CUse a single global lock for all bookings to serialize requests
DUse optimistic locking with retries and real-time slot availability updates
Step-by-Step Solution
Solution:
  1. Step 1: Understand scalability needs

    Thousands of users require a scalable approach that avoids bottlenecks.
  2. Step 2: Evaluate locking strategies

    Single global lock serializes all requests causing delays; manual fixes cause poor user experience.
  3. Step 3: Choose optimistic locking with retries

    This approach allows concurrent attempts, detects conflicts, retries, and updates availability promptly.
  4. Final Answer:

    Use optimistic locking with retries and real-time slot availability updates -> Option D
  5. Quick Check:

    Optimistic locking + updates = scalable concurrency [OK]
Quick Trick: Optimistic locking scales better than global locks [OK]
Common Mistakes:
  • Using global lock causes slow system
  • Ignoring concurrency leads to double bookings
  • Manual conflict fixes harm user experience

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes