Design a General-Purpose Content Embedding Platform
Build and release versioned content embeddings that classification, recommendation, and semantic search can use consistently.
Problem statement
For this exercise, assume a company-neutral catalog of text-bearing content items. A content item has an immutable revision; an update creates a new revision and deletion revokes it.
Design an ML platform that trains a shared content encoder, materializes one vector per eligible item revision and model version, and exposes vectors or nearest-neighbor candidates to three independent downstream teams: classification, recommendation, and semantic search.
Those teams own their task labels, classifiers, ranking decisions, and user-facing policies; this platform owns only the shared representation lifecycle and retrieval contract.
Explain how content changes, model releases, evaluation across all three tasks, serving, and deletion remain correct during retries or partial failures. A response must say which content and model versions produced each vector. An online request must not silently mix vectors from incompatible model generations.
Choose reasonable encoder architecture and storage/index technology; no particular vendor or training method is required.
What to build
- Accept eligible content revisions, generate a vector for each under a declared encoder version, and make processing or failure state observable to its owner.
- Let authorized downstream teams fetch a vector with its item, revision, and model identity, or retrieve bounded nearest-neighbor candidates from one compatible vector generation.
- Train and evaluate candidate encoder versions against classification, recommendation, and search measures, then safely activate or roll back one generation for online reads.
- A deletion or loss of eligibility promptly prevents new vector reads and retrieval hits for the item while historical copies are cleaned up.
At scale
- For this exercise, assume 50 million eligible content items, up to two million new or changed revisions per day, and 768-dimensional vectors; index construction and storage layout must account for this size.
- For this exercise, target 15 minutes at p95 from an accepted content revision to an available embedding, with explicit lag or failed state when that target is missed.
- For this exercise, support 10,000 vector reads and 1,000 nearest-neighbor queries per second at peak; target 80 ms p95 for a vector read and 200 ms p95 for a first-page neighbor query under healthy capacity.
- For this exercise, revoke a deleted item's visibility from new reads within one minute, even if embedding jobs or vector-index cleanup are delayed; a zone failure must not erase acknowledged revision or revocation state.