ML SYSTEM DESIGN (DEEP DIVES) · INTERVIEW QUESTION
Search results must reflect inventory changes within one minute. Which parts of the architecture need that freshness?
🔴 advanced · e-commerce search ranking
Hint: Inventory and relevance have different freshness needs.
Answer
Inventory eligibility and deletions need a fast update path, while slower relevance embeddings can remain versioned.
Interview reasoning
State separate freshness SLOs and enforce final eligibility before rendering.
Separate semantic relevance from hard purchase eligibility. Inventory changes need a fast path even if document embeddings refresh slowly. Build judgments and exposure-aware feedback at the query-product level, then assess query cohorts and purchase completion, not just clicks or aggregate NDCG.
Worked example. A one-minute stock freshness SLO requires timely eligibility updates and a final inventory check.
Validation
Inject stock changes and deletions; verify rendered eligibility updates within the one-minute SLO.
Monitor zero-result rate, inventory violations, query-level relevance and conversion; hold out later queries and new catalog items.
Common pitfalls
offline relevance improves while unavailable items dominate results
Final filtering of only the top few results can leave no alternatives. Better offline ranking cannot repair unavailable products.
Likely follow-up: How would you create relevance labels for product search without treating every non-click as irrelevant?
Related questions
- Design a YouTube-scale video recommendation system serving billions of users.
- Design a production RAG system for an enterprise knowledge assistant (10TB docs, 50k employees, ACL-aware).
- Design a real-time payment fraud detection system (10k+ TPS, 100ms decision budget, delayed labels).
- Design X (Twitter) home timeline ranking — including in-network and out-of-network candidate sources.
- Design an ads CTR prediction and auction system for a major web property (100k QPS, 50ms budget).