RAG (Retrieval Augmented Generation) Interview Questions
Core Concepts
Q: Explain RAG architecture end to end.
RAG = Retrieval Augmented Generation. Combines a retrieval system with an LLM to answer questions from private/recent documents.
Two phases:
Indexing (offline):
Retrieval + Generation (online):
Q: What chunking strategies exist? How do you choose?
Fixed-size chunking: Split every N tokens with M token overlap.
Recursive character splitting: Split by paragraphs → sentences → words if needed.
RecursiveCharacterTextSplitter — most common.Semantic chunking: Embed sentences, split where embedding similarity drops significantly.
Document-structure-aware: Split by markdown headers, PDF sections, HTML tags.
Parent-child chunking: Store small chunks (for precise retrieval) + large chunks (for context in answer).
Retrieve small → return parent chunk to LLM.
Q: How do you evaluate RAG pipeline quality?
RAGAS framework (key metrics):
| Metric | Measures | Formula |
|---|
|---|---|---|
| **Faithfulness** | Is answer grounded in retrieved context? (no hallucination) | Claims in answer ÷ claims supported by context |
|---|---|---|
| Answer Relevance | Does answer address the question? | LLM scores relevance |
| Context Recall | Did retrieval find all relevant chunks? | Relevant retrieved ÷ total relevant |
| Context Precision | Were retrieved chunks relevant? | Relevant retrieved ÷ total retrieved |
Offline evaluation: Build eval dataset (questions + ground truth answers + relevant documents). Run RAGAS.
Online evaluation: Log queries → sample → human review. Track faithfulness score over time.
Q: Advanced RAG techniques — what are they?
HyDE (Hypothetical Document Embedding): Generate hypothetical answer → embed it → search with hypothesis vector instead of question vector. Better semantic match for factual questions.
Multi-query retrieval: Generate 3-5 variations of the user's question → retrieve for each → merge results (union or RRF). Catches different phrasings.
Re-ranking: Retrieve 20-50 candidates → re-rank with cross-encoder (e.g., Cohere Rerank, bge-reranker) → return top 3. Better than pure vector similarity.
Self-RAG: LLM decides when to retrieve (not every query needs retrieval). Model generates "retrieve" tokens to trigger search, "relevant"/"irrelevant" tokens to filter results.
Hybrid search: Vector similarity + BM25 keyword search → combine with RRF (Reciprocal Rank Fusion). Better for exact term matches.
Q: Production RAG — what fails and how do you fix it?
| Problem | Symptom | Fix |
|---|
|---|---|---|
| Wrong chunks retrieved | Answer misses key info | Better chunking, metadata filters |
|---|---|---|
| Hallucination | Answer not in retrieved context | Add faithfulness prompt, lower temperature |
| Slow retrieval | High latency | Index optimisation, approximate search (HNSW), caching |
| Too much context | LLM ignores middle chunks | Compress/summarise chunks, use re-ranking |
| Poor embedding quality | Wrong semantic matches | Switch to better model (bge-large, text-embedding-3-large) |
| Stale knowledge | Outdated answers | Refresh embeddings pipeline on document update |
Production stack example:

