Implement a reservation widget with pricing

Quick Overview

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 reservation widget with pricing

Company: Airbnb

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Onsite

Implement a lodging reservation widget with: ( 1) 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; ( 2) validation that check-out is after check-in and that guest counts do not exceed capacity; ( 3) a disabled “Book Now” button when the room is sold out or selection is invalid; ( 4) 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.

Quick Answer: 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.

|Home/Software Engineering Fundamentals/Airbnb
Airbnb logo
Airbnb
Aug 12, 2025, 12:00 AM
mediumSoftware EngineerOnsiteSoftware Engineering Fundamentals
7
0

Implement a Lodging Reservation Widget

Context

You are building a reservation widget for a property details page. The widget must let guests select dates and guest counts, show a price, validate inputs and availability, and submit a reservation. Assume there is an API that exposes availability by date, rate rules, capacity, and a quote endpoint.

Requirements

  1. Inputs and Pricing
    • Inputs: Check-in date, Check-out date, Adults, Children.
    • Compute total price based on: nightly rate, number of nights, and dynamic pricing that depends on selected adults and children.
    • Show an itemized price breakdown.
  2. Validation
    • Check-out must be after check-in.
    • Guest counts must not exceed capacity and must satisfy rate plan rules (e.g., max adults/children, min nights).
  3. Booking Action
    • Disable the "Book Now" button if the room is sold out for any selected night or the selection is otherwise invalid.
  4. Confirmation
    • On submit, display a confirmation dialog summarizing dates, guests, and the price breakdown before finalizing.
  5. Design Artifacts to Provide
    • Describe component state, data models, and error states.
    • Outline how you would test edge cases (minimum nights, partial availability, timezone/daylight-saving transitions, and price rounding).
Loading comments...