Backend system design · about 45 minutes
Product search service
Design the search backend of an online store with 50 million products. Users type a query and get ranked results in under 200 ms, filter by category, price and brand, and see suggestions as they type. Products change all the time: prices and stock update thousands of times a minute, and a product out of stock should drop out of results quickly.
Ask first
- How many searches a second at peak, and how many product updates a minute?
- What matters for ranking: text match, popularity, stock, margin, personal history?
- How fresh must results be after a change: seconds or minutes?
- Which languages, and do we need typo tolerance and synonyms?
- Is autocomplete part of this service?
The outline
Write your own outline for each part first.
The strong answer, the pitfalls and the follow-ups opens with a year in the app. What a year includes