0
0
LLDsystem_design~5 mins

Hotel, Room, Booking classes in LLD - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the main responsibility of the Hotel class in a hotel booking system?
The Hotel class manages hotel details like name, location, and a list of rooms it contains. It acts as a container for rooms and provides methods to add or find rooms.
Click to reveal answer
beginner
What attributes are typically included in the Room class?
The Room class usually includes attributes like room number, type (single, double, suite), price, and availability status.
Click to reveal answer
intermediate
How does the Booking class relate to Hotel and Room classes?
The Booking class represents a reservation and links a customer to a specific Room in a Hotel for a date range. It manages booking details like check-in and check-out dates.
Click to reveal answer
intermediate
Why is it important to check room availability before creating a Booking?
Checking room availability prevents double-booking the same room for overlapping dates, ensuring a reliable and consistent booking system.
Click to reveal answer
advanced
What design principle helps keep Hotel, Room, and Booking classes organized and maintainable?
Single Responsibility Principle: each class should have one clear responsibility, making the system easier to understand and modify.
Click to reveal answer
Which class should store the price of a hotel room?
AHotel
BBooking
CRoom
DCustomer
What does the Booking class primarily represent?
AA hotel location
BA reservation for a room
CA list of rooms
DA room's features
Which method is essential in the Hotel class to support booking?
ACancelBooking()
BCalculateRevenue()
CAddRoom()
DCheckRoomAvailability()
Why should the Booking class include check-in and check-out dates?
ATo determine booking duration
BTo calculate room size
CTo assign room numbers
DTo store hotel location
Which design principle suggests each class should have one responsibility?
ASingle Responsibility Principle
BOpen/Closed Principle
CLiskov Substitution Principle
DDependency Inversion Principle
Explain how Hotel, Room, and Booking classes interact in a hotel booking system.
Think about who owns what and how bookings are made.
You got /4 concepts.
    Describe the key attributes and methods you would include in the Room class.
    Focus on what defines a room and how it can be managed.
    You got /5 concepts.