Design search autocomplete ML system
ShopifyMachine Learning Engineer · OnsiteLast updated
This question evaluates an engineer's ability to design an ML-powered search autocomplete system, testing competencies in candidate generation versus ranking architectures, data sourcing and labeling, feature and model selection (including personalization and context), offline training and online serving, experimentation and monitoring, and safety and abuse mitigation within information retrieval. Commonly asked to assess how applicants balance production concerns such as latency, relevance, scalability, cold-start handling, and feedback-loop mitigation, it sits in the ML system design domain and emphasizes practical, applied engineering trade-offs rather than purely conceptual theory.
Design an ML-powered search autocomplete system that suggests query completions as the user types (e.g., after typing a prefix like "ipho" suggest "iphone 15", "iphone charger", etc.).
Your design should cover:
- Product requirements and success metrics (latency, relevance, CTR, coverage, diversity, safety/policy).
- Data sources and labeling strategy (logs, impressions/clicks, position bias).
- Candidate generation vs ranking architecture.
- Features and model choices (including personalization and context).
- Offline training pipeline, evaluation, and online serving (latency budgets, caching, fallback).
- Experimentation (A/B testing), monitoring, and mitigation of feedback loops.
- Handling cold start, new trending queries, and abuse/spam queries.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.