Implement a reservation widget with pricing
AirbnbSoftware Engineer · OnsiteLast updated
This question evaluates skills in frontend component state design, data modeling, pricing computation, validation logic, error handling, and API integration for a lodging reservation widget.
Implement a lodging reservation widget with: (
- inputs for check-in and check-out dates; compute total price based on nightly rate, length of stay, and dynamic pricing that changes with selected adults and children; (
- validation that check-out is after check-in and that guest counts do not exceed capacity; (
- a disabled “Book Now” button when the room is sold out or selection is invalid; (
- a confirmation dialog on submit. Describe component state, data models, and error states; outline how you would test edge cases such as minimum nights, partial availability, timezone/daylight-saving transitions, and price rounding.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.