Loading LLD design...
Design an object-oriented hotel management system that handles room inventory, guest registration, reservations, check-in/check-out with invoice generation, and housekeeping tasks.
The system models a room hierarchy (Single, Double, Suite, Deluxe), a reservation lifecycle (PENDING → CONFIRMED → CHECKED_IN → CHECKED_OUT), itemised billing with tax, housekeeping task management, and real-time occupancy reporting.
Search available rooms
Search rooms by type, date range, and amenities
Make a reservation
Reserve one or more rooms for a guest over a date range
Cancel a reservation
Cancel a pending/confirmed reservation and release rooms
Check in
Mark arrival, transition rooms to OCCUPIED
Check out and billing
Generate an itemised invoice (room charges + tax), release rooms
Housekeeping tasks
Create, assign, and complete housekeeping tasks for rooms
Room management
Add/remove rooms, mark rooms for maintenance
Occupancy reporting
Real-time occupancy rate across the hotel
Before diving into code, clarify the use cases and edge cases. Understanding the problem deeply leads to better class design.
Identify the primary actions users will perform. For a parking lot: park vehicle, exit vehicle, check availability. Each becomes a method.
Who interacts with the system? Customers, admins, automated systems? Each actor type may need different interfaces.
What are the limits? Max vehicles, supported vehicle types, payment methods. Constraints drive your data structures.
What happens on overflow? Concurrent access? Payment failures? Thinking about edge cases reveals hidden complexity.