Design Video Search

Hard45 min
1 / 30
understanding7 min read

Problem Statement: Global Video Search

How Problem Statement: Global Video Search (understanding) informs Video Search architecture and interviewer depth.

Problem Statement: Global Video Search

YouTube, TikTok, and Vimeo all treat search as a revenue-critical discovery surface—not a bolt-on SQL LIKE query. The interview tests whether you can separate offline indexing from a sub-200ms online query path while keeping relevance, safety, and freshness measurable.

Problem framing

Anchor this section on measurable search outcomes: p95 latency under 200ms, zero-result rate, CTR@8, and index freshness under five minutes—not offline model accuracy alone.

Design choices
  1. Anchor on hybrid retrieval: BM25 for exact tokens, ANN for paraphrases
  2. Index timed ASR segments so queries hit spoken content inside videos
  3. Rank with LTR using watch-time and quality—not click alone
Deep dive

YouTube, TikTok, and Vimeo all treat search as a revenue-critical discovery surface—not a bolt-on SQL LIKE query. The interview tests whether you can separate offline indexing from a sub-200ms online query path while keeping relevance, safety, and freshness measurable. Tie decisions to catalog scale (~8B videos), ~400M queries/day, and hybrid BM25 plus ANN retrieval with policy gates after learning-to-rank.

Operational detail
  • 500M DAU with ~8B searchable videos sets catalog scale expectations
  • ~400M queries/day implies ~4.6k average QPS and ~14k peak with 3× multiplier
  • p95 query latency target under 200ms drives aggressive top-K caps
  • Index freshness SLA under five minutes after publish is a product promise
  • Null-result rate is as important as median latency for trust
  • Safe-search and kids policy are hard filters after ranking
  • Autocomplete and spell correction sit on a separate low-latency path
  • Vimeo stresses creator-controlled metadata facets and privacy tiers
  • TikTok adds short-form velocity signals to freshness and engagement
  • YouTube-scale inverted indexes shard by videoId hash for even spread
  • Visual embedding search is optional v2—do not block MVP on it
  • Degraded BM25-only mode beats hard 503 when ANN cluster is unhealthy
  • Query logs feed spell dictionaries and trending query caches
  • Channel-name queries need high boost on verified channel fields
  • Phrase queries require separate n-gram fields to avoid token splitting
  • Geo restrictions must filter before results render in UI
  • Copyright-strike videos disappear from index via tombstone events
  • Interviewers probe retrieve-then-rank versus single monolithic ranker
javaOne Dark Pro
1public record SearchScope(long catalogVideos, int peakQps) {
2 public boolean requiresTranscriptIndex() { return true; }
3}
pythonOne Dark Pro
1@dataclass(frozen=True)
2class SearchScope:
3 catalog_videos: int
4 peak_qps: int
typescriptOne Dark Pro
1interface SearchScope { catalogVideos: number; peakQps: number; }
Interviewer positioning

State explicit numbers, name one failure mode for problem statement: global video search, and connect to cost per billion queries or relevance uplift—not generic scalability claims.

Why interviewers care

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

Interview checkpoint

Name one failure story for Problem Statement: Global Video Search that proves you understand real outages, not happy-path diagrams.

Key Highlights

  • Anchor on hybrid retrieval: BM25 for exact tokens, ANN for paraphrases
  • Scale anchor: 500M DAU with ~8B searchable videos sets catalog scale expectations
  • Ops focus: Safe-search and kids policy are hard filters after ranking
Interview tip
Quantify QPS from 400M/day before naming databases.
What impresses
Retrieve-then-rank with explicit degrade path when ANN is unhealthy.
Avoid this
Do not put policy filtering only in the mobile client.

Section Rescue Kit

Buzzwords to use:

BM25HNSW

Safe statements:

  • "I separate indexing pipelines from the online query path."
  • "I size shards from daily query volume and p95 latency targets."
Design Video Search - System Design | WinJob | WinJob