Design Visual Search (Search by Image)
Problem
Design Myntra's "search by image" feature where users upload a photo of a clothing item and get visually similar products from the catalogue.
Requirements
Functional:
- User uploads image → system returns top-20 visually similar products
- Support similarity by: overall style, colour, pattern, product type
- Results ranked by visual similarity + availability + price
Non-functional:
- 100M product images in catalogue
- Query latency < 2s
- Index updated within 24h of new product addition
Discussion points
- Feature extraction: CNN embeddings (ResNet/EfficientNet) → 256-dim vector
- Approximate Nearest Neighbour search: FAISS, ScaNN, or Pinecone
- Offline indexing pipeline vs real-time index updates
- Hybrid ranking: vector similarity + metadata filters (in-stock, price range)
- Cold start: generating embeddings for 100M images in manageable time
added …