Skip to main content

Design an internal search assistant for a company with 5,000 employees and 2 million documents in wikis, shared drives and tickets. Each employee must only get answers from documents they are allowed to open.

System design · Pro 2

Short answer

Clarify sources, the permission model and freshness. Ingest each document with its access list as metadata, sync permission changes quickly, and filter retrieval by the user's identity and groups before any text reaches the model. Use hybrid search and reranking, answer with citations, refuse when nothing relevant is found, and test for leaks.

Deeper answer

Requirements first: which sources, how permissions work in each (users, groups, inherited folders), how fresh answers must be, and the latency target, for example 3 seconds to the first word. Success means correct, cited answers and zero cases of a user seeing text they cannot open.

Data flow: connectors pull documents and their access lists, a pipeline parses, chunks and embeds them, and each chunk stores the allowed groups. At query time the service takes the user's identity from single sign-on, resolves groups, and applies the filter inside the search engine, in code, not in the prompt. Hybrid search finds candidates, a reranker keeps the best few, and the model answers only from those with citations.

Trade-offs: copying access lists into the index is fast but can go stale, so sync permission changes within minutes or check access again at read time for sensitive sources. What breaks first is usually permission sync and filtered search speed for users in many groups. Measure retrieval recall, answer faithfulness, and a leak test where test users ask about restricted documents.

What a strong answer covers

Answer it out loud in the mock interview about 2.5 min

Follow-ups to expect

Common mistakes

Learn it

Permission-aware RAG

Practice System design questions

More on this topic

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.