Multimodal search

A Java engineer's search is an inverted index over words. Multimodal search embeds text and images into one vector space and does nearest-neighbour lookup; the sizing question moves from disk to RAM, and compression trades memory for recall.

45 min round 8 computed numbers 4-part eval plan 8-point rubric
⚠️ Planning numbers, not measurements. Hardware and model facts are dated on the numbers sheet; traffic, prices and efficiency are labelled assumptions. Replace them with your own measurements (the vLLM load-test exercise) before quoting them.

The prompt

Design search where users type text and find images among 100 million photos.

Attempt it first: the 45-minute round

Set the timer, answer out loud or on paper, then score yourself against the rubric before you read the model answer below.

  1. Framing (5 min) — Ask questions, fix the scale and the latency/quality/cost targets, state assumptions with numbers.
  2. Architecture (10 min) — Draw the boxes end to end: data in, the model call, storage, serving, feedback.
  3. Deep dive (15 min) — Pick the hardest part and do the arithmetic: tokens/s, KV memory, QPS → replicas, cost per 1,000 requests.
  4. Trade-offs (10 min) — Name what you would trade (batch vs latency, quality vs cost, build vs buy) and what breaks.
  5. Wrap-up (5 min) — Evaluation plan, monitoring, failure modes, and what you would do next.
45:00
Not started

Self-grade

Tick what you did. 0 of 8.

The model answer, step by step

Five steps, one tap each. The readout gives the step's answer and lists the numbers it uses; the same numbers are highlighted in the table underneath.

Multimodal search, one tap per step

👉 Predict first, then tap. Every number below is computed from the assumptions in the table.

1. Framing

5 min

2. Architecture

10 min

3. Deep dive

15 min

4. Trade-offs

10 min

5. Wrap-up

5 min

Tap a step above.
QuantityHow it is computedValue
Imagesassumption100,000,000
Embedding dimensionassumption768
Product-quantised bytes per vectorassumption64
Index overhead factorassumption1.3
Peak queries per secondassumption1,500
Queries per second one index replica serves (assumed)assumption300
Usable RAM per node, GB (assumed)assumption48
Images embedded per GPU-second (assumed)assumption400
Raw vectors, fp16images × dim × 2153.6 GB
Raw vectors, int8images × dim × 176.8 GB
Product-quantised vectorsimages × 64 bytes6.4 GB
PQ index in RAM with overheadPQ × 1.38.3 GB
Shards by memory (fp16 raw)⌈raw ÷ RAM per node⌉4
Replicas to serve peak QPS⌈qps ÷ per-replica⌉5
One-off embedding GPU-hoursimages ÷ rate ÷ 360069.4
One-off embedding cost at $4/GPU-hourGPU-hours × $4$278
Takeaway. The headline figure — pq index in ram with overhead — is 8.3 GB (PQ × 1.3). Say the assumption, show the formula, then give the number.

The evaluation plan

Go deeper on this site

Check yourself