Interview: RAG System Design Questions
The mixed round: chunking, hybrid search, re-ranking, query rewriting, evaluation metrics, guardrails, streaming, frameworks, cost and latency - plus full mock design questions (support bot, document Q&A over PDFs, code documentation assistant) with strong structured answers.
What you will be able to do
- Answer the core retrieval-toolbox questions
- Choose evaluation metrics for retrieval and answers
- Run a full RAG design with a fixed framework
- Discuss cost, latency, safety and risks
The idea, in plain English
This is the round that mixes everything: quick technical questions about the retrieval toolbox, then a full design problem. Interviewers watch structure and trade-offs more than any single answer.
Use one framework for every design: clarify, requirements, ingestion, query path, evaluation, safety, scale and cost, risks. Say the trade-off of every choice out loud.
Many topics here (chunking, hybrid search, re-ranking, evaluation) get full lessons later in this course; the links point to where they are taught today.
Worked example: Thirteen mixed questions and three mock designs, the way a RAG design interview really runs.
Intermediate: What chunking strategies do you know?
Fixed size with overlap, sentence or paragraph based, structure based (headings, sections, pages), and semantic chunking that splits where the topic changes. Keep metadata (source, section, page) with each chunk.
- Structure-based splitting is a strong default for documents with headings.
- Test on real questions.
Intermediate: Explain hybrid search and how results are combined.
Run keyword search (BM25) and vector search, then merge the lists - often with reciprocal rank fusion, which adds up scores based on each result's rank in each list.
- Keywords catch codes and names; vectors catch paraphrases.
Intermediate: What is re-ranking?
A second stage after fast retrieval: a cross-encoder reads the question and each candidate together and scores relevance more precisely. Retrieve 20-50, re-rank, keep the best few.
- Better precision for some extra latency; cannot find what stage one missed.
Intermediate: Which metrics do you use to evaluate RAG?
Retrieval: hit rate, recall@k, MRR or nDCG on questions with known relevant chunks. Answers: correctness, faithfulness to the context, answer relevance, citation accuracy - plus latency and cost.
- LLM-as-judge for faithfulness, checked against human labels.
Intermediate: How many chunks should you put in the prompt?
Enough to contain the answer, few enough to keep cost, latency and noise low - often 3 to 8. Tune it on the test set; put the most relevant chunks first.
- More chunks can make answers worse, not better.
Advanced: What guardrails would you add to a RAG system?
Input: permission checks, prompt-injection screening, rate limits. Output: answer only with citations, refuse when no relevant context, remove personal data, validate the format, and block unsafe content.
- Guardrails run in code, not only in the prompt.
Advanced: Would you use a framework like LangChain or LlamaIndex?
For a prototype, frameworks speed things up. In production, use them where they help (loaders, integrations) but keep the core pipeline understandable and testable; some teams write the core in plain code.
- Know what the framework does underneath.
Advanced: How do you serve a RAG system as an API?
A web service (for example FastAPI) with authentication, input validation, the query pipeline behind an endpoint, streaming responses, timeouts and concurrency limits, health checks, and tracing.
- Ingestion runs separately - as background workers.
Professional: Mock design: a customer support bot for an online shop.
Clarify channels, languages, question types and actions. Ingest help articles, policies and product data with structure-based chunks and metadata. Query: clean query -> hybrid retrieval -> re-rank -> answer with citations; order questions go to tools with the user's identity, not RAG. Add "I don't know" and human hand-off. Evaluate on real tickets; track resolution rate and cost per conversation.
- Separate document knowledge (RAG) from personal data (tools/APIs).
Professional: Mock design: question answering over 50,000 PDFs (contracts and reports).
Focus on parsing: layout-aware extraction, tables, scanned pages with OCR. Chunk by sections with page numbers, add metadata (client, date, type), hybrid search with filters, re-ranking, answers that cite page and section. Add evaluation with lawyers' or analysts' questions, and permissions per client.
- Parsing quality decides everything for PDFs.
Professional: Mock design: a documentation assistant for developers.
Ingest docs, READMEs, API references and code comments with version metadata; chunk by heading and keep code blocks whole; hybrid search so exact function names match; answers with links to the exact doc section and version; evaluate on real support questions.
- Versions matter - filter to the version the user runs.
Professional: How do you decide whether a use case needs RAG at all?
Ask whether the answers live in documents and need citations (RAG), in structured data (SQL or APIs), in a fixed process (a workflow), or in the model's general knowledge (plain prompting). Many products combine them.
- Counts and totals belong to databases, not RAG (Lesson 1.7).
Professional: What are the top risks in your RAG design, and how do you reduce them?
Wrong answers (evaluation, citations, "I don't know"), data leaks (permission filters, isolation tests), prompt injection (layered defences), stale content (incremental ingestion, freshness alerts), cost overruns (budgets, routing), and outages (fallbacks).
- Ending with risks shows senior judgement.
Key points
- Use one design framework and say the trade-offs out loud.
- Retrieval toolbox: chunking, hybrid search, re-ranking, query rewriting, filters.
- Evaluate retrieval and answers separately.
- Guardrails in code; permissions in retrieval.
- End every design with risks and a rollout plan.
Interview questions
What is BM25?
A classic keyword ranking method.
What is reciprocal rank fusion?
A way to merge ranked lists using each result's rank.
What is nDCG?
A ranking metric that rewards relevant results near the top.
What is a cross-encoder?
A model that scores a question and passage together.
What is semantic chunking?
Splitting text where the topic changes.
Why keep page numbers in metadata?
So answers can cite the exact page.
What is answer relevance?
Whether the answer actually addresses the question.
Where does ingestion run in production?
In background workers, separate from the query API.
Comments
Sign in to leave a comment. Your name and photo come from Google; nothing else is shared.
Loading comments...