Knowledge Guide
HomeOO & Low-Level DesignOO Design Problems

Design a Hotel Management System

Let's design a hotel management system.

A Hotel Management System is a software built to handle all online hotel activities easily and safely. This System will give the hotel management power and flexibility to manage the entire system from a single online portal. The system allows the manager to keep track of all the available rooms in the system as well as to book rooms and generate bills.

Image
Image

System Requirements

We'll focus on the following set of requirements while designing the Hotel Management System:

  1. The system should support the booking of different room types like standard, deluxe, family suite, etc.

  2. Guests should be able to search the room inventory and book any available room.

  3. The system should be able to retrieve information, such as who booked a particular room, or what rooms were booked by a specific customer.

  4. The system should allow customers to cancel their booking - and provide them with a full refund if the cancelation occurs before 24 hours of the check-in date.

  5. The system should be able to send notifications whenever the booking is nearing the check-in or check-out date.

  6. The system should maintain a room housekeeping log to keep track of all housekeeping tasks.

  7. Any customer should be able to add room services and food items.

  8. Customers can ask for different amenities.

  9. The customers should be able to pay their bills through credit card, check or cash.

Use case diagram

Here are the main Actors in our system:

Here are the top use cases of the Hotel Management System:

Image
Image

Class diagram

Here are the main classes of our Hotel Management System:

Image
Image
Image
Image

Activity diagrams

Make a room booking: Any guest or receptionist can perform this activity. Here are the set of steps to book a room:

Image
Image

Check in: Guest will check in for their booking. The Receptionist can also perform this activity. Here are the steps:

Image
Image

Cancel a booking: Guest can cancel their booking. Receptionist can perform this activity. Here are the different steps of this activity:

Image
Image

Code

Here is the high-level definition for the classes described above.

Enums, data types, and constants: Here are the required enums, data types, and constants:

java
public enum RoomStyle {
    STANDARD, DELUXE, FAMILY_SUITE, BUSINESS_SUITE
  }

  public enum RoomStatus {
    AVAILABLE, RESERVED, OCCUPIED, NOT_AVAILABLE, BEING_SERVICED, OTHER
  }

  public enum BookingStatus {
    REQUESTED, PENDING, CONFIRMED, CHECKED_IN, CHECKED_OUT, CANCELLED, ABANDONED
  }

  public enum AccountStatus {
    ACTIVE, CLOSED, CANCELED, BLACKLISTED, BLOCKED
  }

  public enum AccountType {
    MEMBER, GUEST, MANAGER, RECEPTIONIST
  }

  public enum PaymentStatus {
    UNPAID, PENDING, COMPLETED, FILLED, DECLINED, CANCELLED, ABANDONED, SETTLING, SETTLED, REFUNDED
  }

  public class Address {
    private String streetAddress;
    private String city;
    private String state;
    private String zipCode;
    private String country;
  }

Account, Person, Guest, Receptionist, and Server: These classes represent the different people that interact with our system:

java
// For simplicity, we are not defining getter and setter functions. The reader can
    // assume that all class attributes are private and accessed through their respective
    // public getter method and modified only through their public setter method.

    public class Account {
      private String id;
      private String password;
      private AccountStatus status;

      public boolean resetPassword();
    }

    public abstract class Person {
      private String name;
      private Address address;
      private String email;
      private String phone;

      private Account account;
    }


    public class Guest extends Person {
      private int totalRoomsCheckedIn;

      public List<RoomBooking> getBookings();
    }

    public class Receptionist extends Person {
      public List<Member> searchMember(String name);
      public boolean createBooking();
    }

    public class Server extends Person {
      public boolean addRoomCharge(Room room, RoomCharge roomCharge);
    }

Hotel and HotelLocation: These classes represent the top-level classes of the system:

java
public class HotelLocation {
  private String name;
  private Address location;

  public List<Room> getRooms();
  }

  public class Hotel {
  private String name;
  private List<HotelLocation> locations;

  public boolean addLocation(HotelLocation location);
  }

Room, RoomKey, and RoomHouseKeeping: To encapsulate a room, room key, and housekeeping:

java
public interface Search {
    public static List<Room> search(RoomStyle style, Date startDate, int duration);
  }

  public class Room implements Search {
    private String roomNumber;
    private RoomStyle style;
    private RoomStatus status;
    private double bookingPrice;
    private boolean isSmoking;

    private List<RoomKey> keys;
    private List<RoomHouseKeeping> houseKeepingLog;

    public boolean isRoomAvailable();
    public boolean checkIn();
    public boolean checkOut();

    public static List<Room> search(RoomStyle style, Date startDate, int duration) {
      // return all rooms with the given style and availability
    }
  }

  public class RoomKey {
    private String keyId;
    private String barcode;
    private Date issuedAt;
    private boolean active;
    private boolean isMaster;

    public boolean assignRoom(Room room);
    public boolean isActive();
  }

  public class RoomHouseKeeping
  {
    private String description;
    private Date startDatetime;
    private int duration;
    private HouseKeeper houseKeeper;

    public boolean addHouseKeeping(Room room);
  }

RoomBooking and RoomCharge: To encapsulate a booking and different charges against a booking:

java
public class RoomBooking {
  private String reservationNumber;
  private Date startDate;
  private int durationInDays;
  private BookingStatus status;
  private Date checkin;
  private Date checkout;

  private int guestID;
  private Room room;
  private Invoice invoice;
  private List<Notification> notifications;

  public static RoomBooking fectchDetails(String reservationNumber);
}

public abstract class RoomCharge {
  public Date issueAt;
  public boolean addInvoiceItem(Invoice invoice);
}

public class Amenity extends RoomCharge {
  public String name;
  public String description;
}

public class RoomService extends RoomCharge {
  public boolean isChargeable;
  public Date requestTime;
}

public class KitchenService extends RoomCharge {
  public String description;
}
🤖 Don't fully get this? Learn it with Claude

Stuck on Design a Hotel Management System? Open Claude, copy a block below, and it'll teach you this exact concept — visually and interactively.

🎨 Explain it visually

Build the mental picture, not memorization.

I just read a lesson on **Design a Hotel Management System** (OO & Low-Level Design) and want to truly understand it. Explain Design a Hotel Management System from first principles using ONE vivid real-world analogy and a visual mental model — draw it as ASCII art or a clear step-by-step diagram — with a concrete example using real numbers. Then ask me one question to check I got the mental picture, and wait for my reply. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🤔 Walk me through it (interactive)

Socratic — adapts to where you're stuck.

Teach me **Design a Hotel Management System** interactively. Ask me ONE guiding question at a time, wait for my answer, and adapt to my confusion — build the idea with me step by step instead of explaining it all at once. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧪 Quiz me & fix my gaps

Active recall exposes what you missed.

Quiz me on **Design a Hotel Management System** with 5 questions, easy to tricky, ONE at a time. Tell me if each answer is right; at the end, explain clearly what I got wrong and why. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧠 Make it stick

Intuition + hook + flashcards for long-term memory.

Help me remember **Design a Hotel Management System** for the long term: give the one-sentence intuition, a memorable hook/mnemonic, a tiny worked example, and 3 active-recall flashcards (Q -> A). If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.

📝 My notes