Design a RAG Question-Answering System
Design an internal assistant that answers employees' questions from the company's documents (wikis, tickets, PDFs, chat) using a large language model with retrieval-augmented generation. Answers must cite sources and never show a document the asker cannot access. Plan for 50M document chunks, 20,000 questions per hour, and a p95 answer start under 3 seconds.
How the interview goes
Five phases, and questions the interviewer is likely to ask in each.
1. Requirements
- What happens if the right document exists but the user cannot see it?
- How fresh must answers be after a document changes?
Show a hintHint
Ask what the system should do when it does not know.
2. High-level design
- What runs offline and what runs per question?
- Where does access control live?
Show a hintHint
Split the work into an indexing pipeline and a question path.
3. Deep dive
- How do you choose chunk size?
- A user asks about an error code; how does retrieval find it?
Show a hintHint
Exact identifiers and natural-language meaning need different kinds of search.
4. Scaling
- How do you update the index when 1M documents change in a day?
- How do you cut LLM cost by half?
Show a hintHint
Permissions must be applied before anything reaches the model.
5. Trade-offs
- Bigger context window versus better retrieval?
- Hosted model versus self-hosted?
Show a hintHint
You cannot improve what you do not measure; think about an evaluation set.
Practice this with an AI interviewer
Write your design doc with live diagrams while the interviewer asks one question at a time and pushes on your choices. Get a scored debrief with what to study next.
Start this interview