Design Semantic Search

Hard45 min
1 / 30
understanding9 min read

Problem Statement: Meaning-Based Search at Scale

Problem Statement: Meaning-Based Search at Scale — semantic search interview depth

Problem Statement: Meaning-Based Search at Scale

Design enterprise semantic search (Google-scale meaning-based retrieval, Elastic hybrid kNN, Algolia NeuralSearch-class) for Google/Elastic/Algolia-class workloads. This section covers problem statement: meaning-based search at scale in the understanding phase.

Why interviewers probe here

Frame the product as search infrastructure, not a single FAISS notebook demo.

Operational detail

Anchor on 80M documents, 768-d embeddings, 12k peak QPS, p95 query <120ms including embed step.

Failure and edge cases

Cold-start catalog, cross-lingual query, adversarial long queries blowing embed GPU queue.

Interview checkpoints

  • Checkpoint 1 (understanding): State cosine metric, L2-normalized vectors, and top-50 ANN before rerank. — unique to sec-01.
javaOne Dark Pro
1public record AnnQuery(float[] embedding, int topK, String tenantId) {
2 public AnnQuery {
3 if (embedding.length != 768) throw new IllegalArgumentException("dim mismatch");
4 }
5}
pythonOne Dark Pro
1def reciprocal_rank_fusion(rank_lists: list[list[str]], k: int = 60) -> dict[str, float]:
2 scores: dict[str, float] = {}
3 for ranks in rank_lists:
4 for i, doc_id in enumerate(ranks):
5 scores[doc_id] = scores.get(doc_id, 0.0) + 1.0 / (k + i + 1)
6 return scores
typescriptOne Dark Pro
1export function l2Normalize(vec: number[]): number[] {
2 const norm = Math.sqrt(vec.reduce((s, v) => s + v * v, 0)) || 1;
3 return vec.map((v) => v / norm);
4}

Why interviewers care

Semantic Search interviews reward crisp scope, explicit trade-offs, and failure stories—not generic microservice diagrams.

Interview checkpoint

Name one failure story for Problem Statement: Meaning-Based Search at Scale that proves you understand real outages, not happy-path diagrams.

Key Highlights

  • Users search by intent, not exact keywords—'laptop for video editing' must match 'mobile workstation GPU'.
  • Dual path: offline indexing pipeline + online query orchestration with strict p95 budgets
  • Multi-tenant SaaS: 20k catalogs, isolated namespaces, per-tenant embedding model pins
  • Interviewers expect hybrid retrieval (BM25 + dense ANN) and measurable recall@k / MRR
Staff+ signal
Tie Problem Statement: Meaning-Based Search at Scale to recall@k, p95, and blue/green index flips—not vendor buzzwords.
Say aloud
Quantify embed ms, efSearch, and RRF k before drawing managed service logos.

Section Rescue Kit

Buzzwords to use:

HNSWReciprocal Rank Fusion

Safe statements:

  • "For Problem Statement: Meaning-Based Search at Scale, I will separate ingestion backlog SLOs from query p95 SLOs."
  • "Let me quantify embed milliseconds and ANN efSearch before naming a vendor."
Design Semantic Search - System Design | WinJob | WinJob