Design Airbnb search with dynamic pricing and availability
by onyx_xenon83
77
943
Airbnb's search is tricky because availability and pricing change constantly.
I started with the search flow: user query -> geo filter -> availability check -> ranking -> price computation -> results. Used Elasticsearch for the geo and text search, with a separate availability service backed by a calendar store.
The pricing discussion was where things got complicated. Dynamic pricing depends on seasonality, local events, comparable listings, host preferences. I proposed a pricing microservice that pre-computes nightly rates and caches them.
The interviewer challenged me on freshness. If a host changes their price, how quickly should it reflect in search results? I said near-real-time using change data capture from the pricing DB to the search index.
Where I struggled was the availability calendar at scale. With millions of listings each having a 365-day calendar, the data volume is huge. I proposed compressing consecutive available/unavailable days into ranges but didn't fully work through the query patterns.
The instant book vs request-to-book flow added another layer of complexity that I didn't handle well time-wise.
Rejected, which stings but the interview was a great learning experience. I need to practice time management better for complex design questions.