teacher
Sign in

Hotel Booking

Design a hotel booking system with date-range overlap checks, a pricing strategy and a cancellation refund policy.

45 min5 interactive

Requirements

QuestionDecision
What is booked?A room, for a range of nights
How do guests choose?By room type (Standard, Deluxe, Suite). The system picks any free room of that type
Can two bookings share a night?Not in the same room. Back-to-back is fine: one guest checks out the day the next checks in
How is the price set?Base rate per type, with a pricing rule that can change
What happens on cancellation?The room is released. The refund depends on how close the stay is
Real dates?We use day numbers in code so Java and C++ behave identically; real code uses LocalDate or std::chrono

Out of scope: payments, guest profiles, room amenities, overbooking, multi-hotel search.

1 of 9