RAG interview question · Most asked
Your RAG assistant gives confident but wrong answers about company policy. How do you find and fix the cause?
Scenario Asked in Native AI Engineer · Forward Deployed Engineer (FDE) interviews
Summary
Split the pipeline and measure each part: did retrieval return the right passages (retrieval quality), and did the model answer faithfully from them (generation quality)? Most wrong answers come from retrieval: stale or duplicate documents, bad chunking, missing metadata filters, or the right passage ranked too low. Fix with an evaluation set of real questions so improvements are measured, not guessed.
Longer Answer
- Collect failures into an evaluation set: question, expected answer, the document that should be cited.
- Retrieval metrics: recall@k and MRR for those questions. If the right chunk isn't in the top k, the model never had a chance.
- Retrieval fixes: remove outdated policy versions (or filter by effective date), chunk by section with headings kept, hybrid search (BM25 + vectors) for exact terms and codes, a reranker, query rewriting.
- Generation fixes: instruct the model to answer only from the context and say when it doesn't know, require citations, lower temperature, check faithfulness with an LLM-as-judge or NLI model.
- Guardrails: show sources to users; refuse when retrieval confidence is low.
- Monitor: thumbs-down rate, unanswered questions, citation clicks; add new failures to the eval set.
Key Points
- Separate retrieval from generation.
- Build an eval set from real failures.
- Most errors are retrieval: stale docs, chunking, ranking.
- Hybrid search and reranking help.
- Answer only from context; cite; refuse when unsure.
Explanation
What interviewers look for
A measurement-driven approach that isolates retrieval from generation.
More RAG questions
- RAG leaf: How do you evaluate faithfulness of answers?
- RAG leaf: What metadata filters are essential in enterprise RAG?
- RAG leaf: How do citations should be mapped back to sources?
- RAG leaf: How do you prevent prompt injection via retrieved documents?
- Write a minimal retrieval-augmented generation pipeline: chunk, embed, retrieve and answer with citations.
- How do you make RAG answers grounded and verifiable?
- RAG leaf: How do you measure retrieval quality independently of generation?
- RAG leaf: Explain query rewriting and multi-query retrieval.