Design an image search system like Google lens
PremiumML systemMedium
- Visual search
- Image embeddings
- Contrastive learning
Quick answer
This ML system interview question asks you to design an image search system like Google lens. Aim for a design that turns data into useful predictions in production, then explain the data, training, serving and monitoring. Interviewers want to see how you frame the problem, measure success and keep the model healthy after launch.
The problem
Design an image search system like Google Lens: a user points the phone camera at an object, such as a pair of shoes or a lamp, and gets visually matching products and similar images. The hard parts are the gap between messy phone photos and clean catalog photos, and searching a billion images in milliseconds.
The phone sends the photo; the system finds the main objects, turns each into an embedding and looks up the nearest images in an index. Results show the exact product when it exists and similar items when it does not.
What must an image search system like Google lens do?
- Visual match: For a photo, return the top 20 visually matching products or images.
- Multiple objects: Detect up to 5 objects in a photo and let the user pick one.
How well must it do it?
- Latency: Server time under 400 ms p99 from photo received to results.
- Quality: The exact product appears in the top 10 for at least 60% of queries where it exists in the catalog.
What scale should you design for?
Use these numbers in your estimates.
The scale numbers unlock with this questionUnlock
Key concepts
- Visual search
- Image embeddings
- Contrastive learning
- ANN search
- Object detection
- Product quantization
How you’ll practise
- Problem framing
- Data and labels
- Features and model
- Training and evaluation
- Serving and monitoring
- Wrap-up
Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.
What do interviewers look for?
In any ML system design round.
- Frames the product goal as a clear ML problem
- Defines offline and online success metrics
- Explains where the data and labels come from
- Separates training from serving and keeps features consistent
- Plans for drift, retraining and rollbacks
- Weighs model quality against latency and cost
Questions people ask about this interview question
- Which design type is this question?
- It is an ML system question. You design an image search system like Google lens and explain your choices the way you would in an interview.
- Is this question asked at entry level?
- It is marked Medium. Entry-level engineers can practise it, but it expects you to reason about requirements and trade-offs, not only list components.
- What should I cover first?
- Start with the product goal, how success is measured and what data is available. Agree on scope with the interviewer before you design anything.
- Can I practise it for free?
- It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.
Related questions
Updated · Written by the SevyDevy team