Design Access-Aware Design-File Retrieval and Ranking
Design a low-latency search service that retrieves only authorized design files and degrades safely when its ranking dependency is unavailable.
Problem statement
For this exercise, assume organizations contain teams, nested folders, and design files. Members have organization and team roles, folders can grant or restrict access, and a file may add a bounded explicit override.
An authorized member submits a short text query with optional organization, team, folder, owner, file-type, and updated-time filters and receives ranked file summaries.
Treat the learned ranking service as an existing dependency: this system owns candidate retrieval, authorization, feature assembly, ranker invocation, pagination, and a deterministic fallback, but not ranking-model training.
A file must never appear to a principal who lacks current read access, including after role removal, folder moves, or access revocation. Content and metadata indexing may be asynchronous, while authorization remains fail closed when current access cannot be established.
If the ranker is slow or unavailable, return an explicitly degraded result ordered by a stable lexical and recency fallback rather than failing every query or leaking broader candidates.
Design ingestion and change propagation, the hierarchy and access model, indexes, query and pagination contracts, ranking and fallback paths, caches, consistency, failure recovery, and observability.
File editing, collaborative synchronization, binary storage, ranking-model internals, recommendations, and cross-organization discovery are outside scope.
What to build
- The service ingests versioned file content and metadata plus organization, team, folder, membership, and access changes into rebuildable search projections.
- An authenticated member can search with a short query and bounded filters and receive only currently readable file summaries with stable pagination.
- The service ranks authorized candidates with the existing ranking dependency and returns a labeled deterministic fallback order when that dependency misses its budget.
- Role changes, revocations, and folder moves stop unauthorized disclosure within the stated bound, and operators can detect and repair stale index or permission projections.
At scale
- For this exercise, assume 100,000 organizations, 500 million design files, and highly skewed organizations with up to ten million files and deep folder subtrees.
- For this exercise, support 20,000 search requests and 50,000 file, metadata, hierarchy, or access updates per second at peak.
- For this exercise, target 250 milliseconds p95 for healthy searches, 350 milliseconds p95 for degraded fallback, and make ordinary content updates searchable within 60 seconds.
- For this exercise, enforce access revocation within five seconds, fail closed when current access is uncertain, and preserve accepted index changes through a zone failure.