Bird
0
0

You are designing an availability checking system for a hotel booking platform. Which approach best ensures high availability and scalability when checking room availability in real-time?

hard📝 Trade-off Q15 of 15
LLD - Design — Hotel Booking System
You are designing an availability checking system for a hotel booking platform. Which approach best ensures high availability and scalability when checking room availability in real-time?
AUse a centralized database with locking to check and update availability synchronously
BCache availability data in memory with periodic sync to the database and use optimistic concurrency
CCheck availability by scanning all booking records on every request without caching
DAllow double booking and resolve conflicts manually later
Step-by-Step Solution
Solution:
  1. Step 1: Understand requirements for high availability and scalability

    System must respond quickly and handle many requests without blocking.
  2. Step 2: Evaluate options for real-time availability checking

    Cache availability data in memory with periodic sync to the database and use optimistic concurrency uses caching and optimistic concurrency, reducing database load and avoiding locks, improving scalability and availability.
  3. Final Answer:

    Cache availability data in memory with periodic sync to the database and use optimistic concurrency -> Option B
  4. Quick Check:

    Caching + optimistic concurrency = scalable availability [OK]
Quick Trick: Cache data and use optimistic concurrency for scalable availability [OK]
Common Mistakes:
  • Using locking causing bottlenecks
  • Scanning all records causing slow response
  • Allowing double booking causing user issues

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes