Preparing your design workspace

Loading the problem and your latest saved attempt…

Design Personalized Customer Document Search

Retrieve authorized customer documents for a query and personalize ranking from permitted requester behavior without sacrificing relevance, privacy, freshness, or safe fallback.

Problem statement

Design a customer-document search platform whose ranking is personalized to the requester’s search behavior.

For this exercise, assume each authenticated requester searches text documents inside one customer workspace and may see only documents allowed by the workspace’s current user and group grants.

A versioned document contains a stable workspace ID, document ID, title, body text, bounded filterable metadata, update time, and access-policy version. Return up to 20 authorized summaries for a query.

Personalization may use explicitly permitted prior queries, result impressions, clicks, and profile preferences, but relevance to the current query remains essential and a requester with no history receives a useful query-only ranking.

For this exercise, assume acknowledged document upserts become searchable within five minutes. A deletion or access revocation must stop the document from appearing in new results immediately through an authoritative visibility check, while all serving-index copies are purged within 24 hours.

If semantic retrieval, personalization features, or the learned ranker are absent, stale, incompatible, or unavailable, serve a lexical query-relevance fallback that still enforces current authorization, or return an explicit unavailable response when authorization cannot be established.

Training uses only explicitly permitted behavior and content-derived features.

Design ingestion, authorization-safe retrieval, ranking and personalization, feedback collection, offline and online evaluation, model/index compatibility, caching, rollout, deletion and revocation, failure recovery, and observability.

Document editing, binary attachments, generated answers, cross-workspace discovery, and authoring access policy are outside scope.

What to build

  1. Return up to 20 query-relevant document summaries that the requester is currently authorized to read, with a stable query-only cold-start path.
  2. Use explicitly permitted requester behavior and preferences to improve ranking without allowing personalization to overwhelm current-query relevance.
  3. Index accepted document versions within five minutes, hide acknowledged deletions or access revocations immediately, and purge stale serving copies within 24 hours.
  4. Build consented training examples, evaluate retrieval and personalized ranking, and safely release or roll back compatible model, feature, and index versions.

At scale

  • For this exercise, assume 10,000 customer workspaces and one billion retained text documents, with highly skewed workspace sizes.
  • For this exercise, assume peaks of 50,000 document updates and 20,000 searches per second, with a 400 millisecond p95 end-to-end search target.
  • For this exercise, queries contain at most 200 characters, searchable text per document is at most 100 KB, and a requester belongs to at most 100 access groups.
  • For this exercise, a ranking or feature outage may reduce quality, but search must never cross workspace boundaries, expose a currently unauthorized document, or revive an acknowledged deletion.