EasyDeepLearn

Interview: you must ship an embedding service serving 100M vectors, 10ms p95 latency.

hard

Answer

  • (1) Choose embedding model by quality + latency (E5-small / bge-small / OpenAI text-embedding-3-small).
  • (2) Batch-embed the corpus offline.
  • (3) Index in HNSW (Qdrant, pgvector, Weaviate) — M=32, efconstruction=200\mathrm{ef}_{\mathrm{construction}} = 200.
  • (4) Serve queries: encode + ANN.
  • (5) Cache popular queries.
  • (6) Sharding by partition key + horizontal scale.
  • (7) Cold-index rebuild + hot-swap for updates.
  • (8) Monitor: recall@k, latency percentiles, index memory.
  • (9) Consider IVF-PQ if memory-constrained.
  • (10) Backup index.
Check yourself — multiple choice
  • Random
  • Choose embed model by quality/latency + offline batch embed + HNSW index + shard + cache + hot-swap for updates + monitor recall/latency + IVF-PQ if memory tight
  • Just brute force
  • Not real

100M vectors 10ms: model choice + batch embed + HNSW + shard + cache + monitor.

#interview#applications

Practise Unsupervised Learning

214 interview questions in this topic.

Related questions