This question evaluates backend system design and data engineering competencies, including scalable API design, time-range aggregation correctness (handling partial overlaps and state changes), data modeling and indexing, caching and precomputation, and performance validation.
Design the backend for a host (landlord) listings page.
User flow:
Assume you start with these tables:
Listings(listing_id, host_id, ... )
Reservations(reservation_id, listing_id, start_date, end_date, status, ... )
Pricing(listing_id, date, price, currency, ... )
Problem:
Task: