Design a fault-tolerant Search System
Quick Overview
Design a fault-tolerant search system handling millions of requests. Discuss consistency, availability, and performance trade-offs.
Walmart
7
Design a fault-tolerant search system handling millions of requests. Discuss consistency, availability, and performance trade-offs.
Product search is one of Walmart's highest-traffic surfaces, and ML system design rounds probe how ranking models survive failures without hurting relevance. The interviewer looks for a retrieval and ranking pipeline with sensible fallbacks, plus clear reasoning on latency, freshness, and consistency of the index.
What the Interviewer Expects
- Frame search as retrieval plus learning to rank with a clear objective such as purchase or click
- Identify data and features: catalog, inventory, query logs, and user behavior
- Propose a two-stage design with a fast retriever and a heavier ranker
- Design fallbacks when the ranker or feature store is down (serve retrieval order or cached results)
- Discuss index replication, freshness of price and stock, and latency budgets
- Define offline and online metrics such as NDCG and conversion
Key Topics to Cover
How to Approach This
- Start by mapping the business objective to a concrete ML objective and metric.
- Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
- Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
- Address the serving latency budget and whether batch or real-time inference is needed.
- Think about the data flywheel: how user feedback improves the model over time.
Possible Follow-up Questions
- What does the system return if the ranking model service times out?
- How do you keep stock and price fresh in the index without full rebuilds?
- How would you evaluate a new ranker safely before full rollout?
- How do you handle a sudden spike of a new query, like a viral product?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice ML System Design ProblemsSample Answer
Problem Formulation
The primary business problem is to design a fault-tolerant search system for Walmart that can efficiently handle millions of search requests from users looking for products. This can be formulated as ...
Data & Features
The data sources for this system include:
- Product Catalog: Structured data containing product IDs, descriptions, categories, prices, and stock levels.
- User Behavior Logs: Clickstream dat...