CrackML by @ml.with.umang
Interview questions / ML System Design
ML System Design interview question

Design Text-to-Image Search

Design semantic search that retrieves relevant images for a natural-language query.

hardsystem designEvidence 66/1001 source reportAmazon

The 60-second answer

Define relevance, corpus scale, update rate, latency, safety/rights filters, and whether exact lexical signals should complement semantic retrieval. Train/use aligned text-image encoders, precompute image embeddings, build an ANN index, retrieve candidates, then optionally rerank with a richer cross-modal model.

Build the answer in this order

1
Frame the problem

Define relevance, corpus scale, update rate, latency, safety/rights filters, and whether exact lexical signals should complement semantic retrieval.

2
Design the data path

Train/use aligned text-image encoders, precompute image embeddings, build an ANN index, retrieve candidates, then optionally rerank with a richer cross-modal model.

3
Choose the modeling stack

Use hard negatives and query/image diversity in training; handle new images and index refresh without full rebuilds where possible.

4
Serve, evaluate, iterate

Evaluate recall@K/NDCG, semantic failure slices, tail queries, latency, index freshness, and online search success.

A useful interview mental model

This is the shape of a strong answer—not a script to memorize.

01Requirements
02Data
03Model / Retrieval
04Serving
05Monitor

Senior-level signal

  • Senior answers separate embedding-model quality from ANN approximation/index quality.
  • Discuss multimodal safety/rights filtering, embedding version migration, and shadow indexes for safe rollout.

What the interviewer is really testing

Product framing, data design, modeling choices, serving constraints, reliability, evaluation, and explicit trade-offs.

Likely follow-up questions

What changes at 10× traffic or data volume?
Which failure mode would you monitor first in production?
How would you evaluate this offline and online before rollout?

Common weak-answer patterns

  • Jumping to a model before defining the product contract.
  • Listing components without bottlenecks, metrics, or failure handling.
  • Ignoring data quality, serving latency, monitoring, and iteration.