Interview Q&A · 24 questions · 5 answered publicly
RAG Interview Questions
Ordered by how often they're asked. Sign in free to see every answer, rate your confidence and run timed mock interviews.
-
Most asked RAG leaf: How do you measure retrieval quality independently of generation?
Summary
Use labeled query->doc sets and compute recall@k, MRR, nDCG before looking at answer quality.
Longer Answer
Use labeled query->doc sets and compute recall@k, MRR, nDCG before looking at answer quality. Track citation hit rate separately from fluency.
Key Points
- Use labeled query->doc sets and compute recall@k, MRR, nDCG before looking at answer quality
- Track citation hit rate separately from fluency
- Separates retrieval vs generation failures
- Use the answer to connect the concept back to a realistic production or interview scenario for 'RAG leaf: How do you measure retrieval quality independently of generation?'
Comparison / Tradeoffs
Aspect Notes Core idea Use labeled query->doc sets and compute recall@k, MRR, nDCG before looking at answer quality. Practical tradeoff Separates retrieval vs generation failures. -
Most asked RAG leaf: Explain query rewriting and multi-query retrieval.
Summary
LLM expands/clarifies the user query or generates multiple reformulations; retrieve per query and fuse (RRF).
Longer Answer
LLM expands/clarifies the user query or generates multiple reformulations; retrieve per query and fuse (RRF). Improves recall for vague questions.
Key Points
- LLM expands/clarifies the user query or generates multiple reformulations; retrieve per query and fuse (RRF)
- Improves recall for vague questions
- Common recall booster
- Use the answer to connect the concept back to a realistic production or interview scenario for 'RAG leaf: Explain query rewriting and multi-query retrieval.'
Comparison / Tradeoffs
Aspect Notes Core idea LLM expands/clarifies the user query or generates multiple reformulations; retrieve per query and fuse (RRF). Practical tradeoff Common recall booster. -
Most asked RAG leaf: How do you prevent prompt injection via retrieved documents?
Summary
Treat docs as untrusted, delimit content, instruct model to ignore embedded instructions, and never grant tools based on doc text alone.
Longer Answer
Treat docs as untrusted, delimit content, instruct model to ignore embedded instructions, and never grant tools based on doc text alone. Security for RAG.
Key Points
- Treat docs as untrusted, delimit content, instruct model to ignore embedded instructions, and never grant tools based on doc text alone
- Security for RAG
- Relevant areas: Ai, Rag, Security
- Use the answer to connect the concept back to a realistic production or interview scenario for 'RAG leaf: How do you prevent prompt injection via retrieved documents?'
Comparison / Tradeoffs
Aspect Notes Core idea Treat docs as untrusted, delimit content, instruct model to ignore embedded instructions, and never grant tools based on doc text alone. Practical tradeoff Security for RAG. -
Most asked RAG leaf: How do you evaluate faithfulness of answers?
Summary
NLI/LLM-as-judge against retrieved context, citation coverage checks, and human spot audits.
Longer Answer
NLI/LLM-as-judge against retrieved context, citation coverage checks, and human spot audits. Fail closed when unsupported.
Key Points
- NLI/LLM-as-judge against retrieved context, citation coverage checks, and human spot audits
- Fail closed when unsupported
- Groundedness evaluation
- Use the answer to connect the concept back to a realistic production or interview scenario for 'RAG leaf: How do you evaluate faithfulness of answers?'
Comparison / Tradeoffs
Aspect Notes Core idea NLI/LLM-as-judge against retrieved context, citation coverage checks, and human spot audits. Practical tradeoff Groundedness evaluation. -
Most asked RAG leaf: How do you choose top-k and context budget?
Summary
Tune k via retrieval metrics then constrain tokens for the generator.
Longer Answer
Tune k via retrieval metrics then constrain tokens for the generator. Rerank to keep fewer, better chunks. Monitor truncation rate.
Key Points
- Tune k via retrieval metrics then constrain tokens for the generator
- Rerank to keep fewer, better chunks
- Monitor truncation rate
- Practical RAG tuning
Comparison / Tradeoffs
Aspect Notes Core idea Tune k via retrieval metrics then constrain tokens for the generator. Practical tradeoff Practical RAG tuning. - RAG leaf: How do citations should be mapped back to sources?
- RAG leaf: What metadata filters are essential in enterprise RAG?
- RAG leaf: When is parent-document retrieval preferable to flat chunks?
- RAG leaf: How do you handle stale documents in a knowledge base?
- RAG leaf: What is late chunking / contextual retrieval?
- RAG leaf: Compare dense retrieval vs sparse (BM25) for code search.
- RAG leaf: How would you RAG over tables and structured data?
- RAG leaf: What caching layers help RAG latency?
- RAG leaf: Explain corrective RAG / self-reflective retrieval loops.
- RAG leaf: How do you ingest PDFs with complex layouts?
- RAG leaf: How do you A/B test a new embedding model?
- RAG leaf: Describe a failure mode when context is contradictory.
- RAG leaf: How does multimodal RAG differ from text-only?
- RAG leaf: What SLOs would you set for a customer-facing RAG assistant?
- RAG leaf: When should you use graph RAG?
- Explain how a typical RAG pipeline works end to end.
- How do you choose chunk size and chunking strategy for RAG?
- What causes hallucinations in RAG systems, and how do you reduce them?
- How do you handle access control and multi-tenancy in a RAG knowledge base?