LLD - Design — Hotel Booking SystemWhy is it important for the Booking class to maintain a reference to the Room object instead of just storing the room number?ATo avoid creating Room objectsBTo access and update room availability and details directlyCBecause room number is not uniqueDTo reduce memory usage by storing fewer detailsCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand object referencesStoring a reference to Room allows Booking to access and modify room properties.Step 2: Benefits of direct accessDirect reference enables updating availability and retrieving room details easily.Step 3: Evaluate other optionsRoom number alone is insufficient for updates; memory usage and uniqueness are not main reasons.Final Answer:To access and update room availability and details directly -> Option BQuick Check:Reference enables direct room updates [OK]Quick Trick: Reference lets Booking update Room properties directly [OK]Common Mistakes:Thinking room number is enough for updatesAssuming memory saving is main reasonConfusing uniqueness of room number
Master "Design — Hotel Booking System" in LLD9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepArchTryChallengeDesignRecallScale
More LLD Quizzes Design — Chess Game - Move validation and check detection - Quiz 7medium Design — Chess Game - Board and piece hierarchy - Quiz 3easy Design — Chess Game - Observer pattern for UI updates - Quiz 9hard Design — Food Delivery System - Rating and review system - Quiz 11easy Design — Food Delivery System - Rating and review system - Quiz 7medium Design — Hotel Booking System - Room type hierarchy - Quiz 1easy Design — Hotel Booking System - Cancellation and refund policy - Quiz 11easy Design — Hotel Booking System - Availability checking - Quiz 5medium Design — Hotel Booking System - Search and filter design - Quiz 15hard Design — Splitwise (Expense Sharing) - Why Splitwise tests financial logic - Quiz 9hard