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:MISTAKESThinking 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 Advanced LLD Concepts - Dependency injection framework - Quiz 14medium Advanced LLD Concepts - Thread safety in design - Quiz 5medium Design — Food Delivery System - Order tracking state machine - Quiz 9hard Design — Food Delivery System - Restaurant, Menu, Order classes - Quiz 10hard Design — Food Delivery System - Order tracking state machine - Quiz 2easy Design — Online Shopping Cart - Order state machine - Quiz 7medium Design — Online Shopping Cart - Notification on state change - Quiz 11easy Design — Splitwise (Expense Sharing) - Split strategies (equal, exact, percentage) - Quiz 1easy Design — Splitwise (Expense Sharing) - Balance calculation algorithm - Quiz 15hard Design — Splitwise (Expense Sharing) - Simplify debts algorithm - Quiz 13medium