1297 RAG (Retrieval-Augmented Generation) interview questions and answers for AI engineers, ML engineers, and GenAI/LLM developers. Covers all 52 RAG architectures, system design scenarios, vector databases, embeddings, chunking, reranking, evaluation, and the production failure modes that come up in real LLM engineering interviews.
⭐ Star this repo if it helps your interview prep — it keeps the project growing.
| Link | Use it for |
|---|---|
| 🧾 Cheatsheet | All 52 RAG types compared in one table — best for a phone screen the same day |
| 🕹️ Interactive Quiz Site | Flip through every Q&A as flashcards, filterable by difficulty, section, and a "Scenario only" toggle, right in the browser |
| 🗺️ Learning Path | Structured curriculum if you have more than a few days to prepare |
| ▶️ Run Lab 01 in Colab | Build a working RAG pipeline in your browser, no local setup |
git clone https://github.com/ather-techie/rag-interview-system.git
cd rag-interview-system/06_labs_py
python3 -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\Activate.ps1
pip install -r requirements.txt
cp .env.example .env # set AI_PROVIDER / AI_MODEL / AI_API_KEY
jupyter lab 01_naive_rag.ipynb
Prefer zero setup? Every lab notebook has an Open in Colab badge — see Labs & Patterns below.
Retrieval-Augmented Generation (RAG) is an LLM architecture that grounds model responses in external knowledge: documents are chunked, embedded, and stored in a vector database; at query time the most relevant chunks are retrieved via vector search and passed to the LLM as context for generation. RAG reduces hallucination, keeps answers current without retraining, and is the most common production pattern for enterprise LLM applications — which is why it dominates AI engineer and GenAI system design interviews.
| # | Topic | Purpose | Questions |
|---|---|---|---|
| 00a | Roadmap | RAG maturity model, skill progression, and interview prep pathway | – |
| 00b | RAG Taxonomy | Classification framework for all 52 architectures across 4 axes | – |
| 00c | Learning Path | Structured curriculum and study plans | – |
| 00d | System Design Principles | Production-grade architecture patterns | – |
| # | Topic | Purpose | Questions |
|---|---|---|---|
| 01a | Embeddings | Embedding models, similarity metrics, and fine-tuning | 2 |
| 01b | Chunking Strategies | Document splitting and chunk optimization | 2 |
| 01c | Vector Databases | Storage, indexing, and hybrid search | 4 |
| 01d | Retrieval Strategies | Dense, sparse, hybrid, and advanced retrieval | 3 |
| 01e | Reranking | Cross-encoders and precision filtering | – |
| 01f | Evaluation Metrics | RAGAS, NDCG, and production monitoring | 2 |
| 01g | Prompt Injection Risks | Security and defense strategies | – |
| 01h | Fine-Tuning for RAG | When and how to fine-tune embeddings and rerankers | 7 |
| 01i | Observability & Evaluation Ops | LLM-as-judge, online metrics, tracing, drift alerts | 7 |
| 01j | Multi-Tenancy & Access Control | Tenant isolation, document ACLs, leakage surfaces | 7 |
| 01k | Document Ingestion & Parsing | Parsing pipelines, layout extraction, and text normalization | 12 |
| 01l | Knowledge Graph Construction | Entity extraction, relation extraction, KG maintenance | 6 |
| 01m | Caching Strategies | Semantic cache, KV preloading, invalidation, cost/freshness trade-offs | 5 |
| 01n | Cost Optimization | Model tiering, prompt caching, quantization, batching | 4 |
| 01o | Agentic Orchestration | Tool-call loops, stopping criteria, ReAct vs. plan-and-execute, full pipeline architecture | 7 |
| 01p | Multimodal Embeddings | CLIP, ImageBind, cross-modal alignment, vision-language models | 3 |
| 01q | Conversational Memory Architecture | Working/episodic/long-term memory, MemGPT paging, session detection | 3 |
Core Concepts Total: 74 questions across 17 files
flowchart TD
RAG["52 RAG Architectures"] --> F["Foundational"]
RAG --> AC["Adaptive & Self-Correcting"]
RAG --> AG["Agentic & Reasoning"]
RAG --> GR["Graph-Based"]
RAG --> LC["Long-Context & Memory"]
RAG --> MS["Multimodal & Structured"]
RAG --> EF["Efficiency & Query Transform"]
RAG --> SR["Security, Trust & Real-Time"]
RAG --> TT["Training-Time / Parametric"]
F --> F1["Naive · Advanced · Modular RAG"]
F --> F2["DPR · ColRAG/ColBERT"]
AC --> AC1["Adaptive RAG"]
AC --> AC2["Corrective RAG (CRAG)"]
AC --> AC3["Self-RAG · Astute RAG"]
AC --> AC4["Speculative RAG"]
AG --> AG1["Agentic RAG · FLARE"]
AG --> AG2["Iterative / Multi-hop RAG"]
AG --> AG3["Search-R1 · Auto-RAG/DeepRAG"]
AG --> AG4["Deep Research · CoRAG · RQ-RAG"]
GR --> GR1["Graph RAG · LightRAG"]
GR --> GR2["HippoRAG · KAG"]
GR --> GR3["GraphReader / GNN-RAG"]
GR --> GR4["LazyGraphRAG"]
LC --> LC1["Long-Context RAG · RAPTOR"]
LC --> LC2["Contextual RAG · LongRAG"]
LC --> LC3["Memory / Conversational RAG"]
LC --> LC4["MemoRAG · Recursive Summarization"]
MS --> MS1["Structured/SQL · Table-Aware RAG"]
MS --> MS2["Multimodal RAG · VisRAG"]
EF --> EF1["CAG · REFRAG"]
EF --> EF2["RAG-Fusion · HyDE · Few-Shot Example RAG"]
SR --> SR1["Verifiable/Citation RAG · SURGE"]
SR --> SR2["Privacy-Preserving · Streaming/Real-Time RAG"]
SR --> SR3["Agentic Web RAG · WebGPT · Tree of Thought RAG"]
TT --> TT1["REALM · RETRO"]
TT --> TT2["Atlas · Fusion-in-Decoder · RAFT"]
Full classification (retrieval control, data modality, feedback loop, scope, latency class) for all 52 types: 00_overview/rag_taxonomy.md.
Naive RAG — Chunk → Embed → Store → Retrieve → Generate
Advanced RAG — Query rewriting + Hybrid search + Re-ranking
Modular RAG — Plug-and-play pipeline components
Agentic RAG — LLM decides when/how to retrieve (ReAct, FLARE)
Graph RAG — Knowledge graph for entity-aware retrieval
Corrective RAG (CRAG) — Evaluates retrieval quality, falls back to web search
Self-RAG — Model trained to reflect, retrieve, and critique itself
Speculative RAG — Small model drafts → Large model selects best
Multi-modal RAG — Retrieve across text, images, tables, audio
Long-context RAG — Stuff entire docs into large context windows
Adaptive RAG — Query classifier routes to no-retrieval / single-hop / multi-hop
Structured / SQL RAG — Text-to-SQL generation for relational database retrieval
RAPTOR — Recursively clusters and summarizes chunks into a multi-level tree
Contextual RAG — LLM-generated context prefix prepended to each chunk before embedding
LightRAG — Entity-relationship graph + dual-level (local + global) retrieval
RAFT — Fine-tunes the LLM generator on oracle + distractor documents
Cache-Augmented Generation (CAG) — Preloads entire corpus into KV cache — no retrieval step at inference
RAG-Fusion — N query reformulations → N parallel retrievals → RRF merge → generation
Iterative / Multi-hop RAG — Retrieve → reason → retrieve loops (IRCoT, Self-Ask) until a stopping criterion
HippoRAG — Personalized PageRank over an LLM-built knowledge graph for single-step multi-hop
Memory / Conversational RAG — Tiered memory + history-aware query rewriting for multi-turn dialogue
HyDE — Embed an LLM-generated hypothetical answer to close the query-document gap
FLARE — Retrieve mid-generation when next-sentence tokens fall below a confidence threshold
KAG (Knowledge Augmented Gen.) — Logical-form reasoning + KG/text mutual indexing for professional domains
GraphReader / GNN-RAG — Agentic graph-of-notes traversal / GNN-retrieved reasoning subgraphs
REALM (training-time) — Retriever learned end-to-end during masked-LM pre-training
RETRO (training-time) — Chunked cross-attention over a trillion-token frozen datastore
Atlas (training-time) — Jointly-trained Contriever + FiD; few-shot knowledge learning
Fusion-in-Decoder (FiD) (training) — Encode passages separately, fuse them in the decoder
ColRAG / ColBERT — Multi-vector late interaction (MaxSim); each token gets its own embedding
Agentic Web RAG — Live web search as retrieval backend; real-time freshness + citation extraction
Few-Shot Example RAG — Retrieves query→answer demonstrations rather than documents; plugged into the prompt
Verifiable / Citation RAG — Inline citations mapped to specific passages; post-hoc attribution verification
Privacy-Preserving RAG — On-device embedding, differential privacy, federated retrieval for zero-trust corpora
Streaming / Real-Time RAG — Continuous index updates from Kafka / CDC; freshness window in seconds
Table-Aware RAG — Structured retrieval over semi-structured tables; row/column linearization or SQL hybrid
Tree of Thought RAG — ToT reasoning branches with conditional per-hypothesis retrieval
DPR (Dense Passage Retrieval) (foundational) — Bi-encoder trained with question–passage contrastive loss
WebGPT / Tool-Augmented LM (foundational) — RLHF-trained to issue browser actions (search/click/quote)
SURGE (Schema-Grounded RAG) — tool_use schema-constrained extraction + per-field NLI grounding validation
Recursive Doc. Summarization RAG — 4-level summary tree (chunk→section→doc→corpus); routes queries to the right level
Search-R1 / Reasoning RAG — RL-trained LLM interleaves reasoning and self-issued search calls
Deep Research / Agentic Research — Parallel plan-search-read-synthesize sub-agents produce a long-form cited report
MemoRAG — Compresses the corpus into a global memory that drafts query-time retrieval clues
LongRAG + Self-Route — Retrieves large (~4K-token) grouped units; Self-Route picks RAG vs. long-context
VisRAG — Embeds and reads document pages as images end-to-end via a VLM
LazyGraphRAG — Cheap noun-phrase co-occurrence graph at index time, LLM work deferred to query time
Astute RAG — Elicits the LLM's own parametric knowledge, reconciles it with retrieved passages
Auto-RAG / DeepRAG — Decides retrieve-vs-reason at every step, not once up-front
CoRAG (Chain-of-Retrieval) — Rejection-sampled retrieval chains; chain length is a test-time compute knob
RQ-RAG — Fine-tunes the LLM to chain query-refinement operations via special tokens
REFRAG — Compresses chunks into embeddings, RL policy expands only the important ones
| # | Topic | Questions |
|---|---|---|
| 03.01 | Hallucination Despite Context | 10 |
| 03.02 | Retrieval Failure | 10 |
| 03.03 | Embedding Mismatch | 10 |
| 03.04 | Stale Index Problem | 10 |
| 03.05 | Context Window Overflow | 10 |
| 03.06 | Reranker Failure | 10 |
| 03.07 | Conversational Context Drift | 10 |
| 03.08 | Cascading Retrieval Failure | 4 |
| 03.09 | Semantic Cache Leakage | 5 |
All cited papers with arXiv/DOI links: REFERENCES.md
Hands-on Jupyter notebooks and composition pattern guides:
| # | Section | Contents |
|---|---|---|
| 04 | Patterns | Router + fallback, fan-out/fan-in, migration path, anti-patterns |
| 06 | Labs | 5 Jupyter notebooks: Naive RAG → Hybrid RAG → Reranker → RAGAS Evaluation → Agentic RAG. Each has an |
| 08 | Evaluation | Golden dataset construction guide + RAGAS CI harness |
| 09 | Tools | Eval & observability tool comparison (Ragas, TruLens, DeepEval, LlamaIndex eval, LangChain eval); vector DB & framework comparisons still planned |
| # | Section | Status |
|---|---|---|
| 05 | Graphs | Planned |
| 07 | Simulator | Planned |
| 10 | Decision System | Planned |
| Step | Do this |
|---|---|
| 1 | Skim cheatsheets/CHEATSHEET.md — all 52 types compared |
| 2 | Read Q1–Q5 of Naive RAG, Advanced RAG, Agentic RAG |
| 3 | Read 00_overview/roadmap.md for the big picture |
| Day | Focus |
|---|---|
| 1–2 | 01_concepts/ — embeddings, chunking, vector DBs, retrieval, reranking |
| 3–4 | 02_interview_bank/ — all 52 architectures, all questions |
| 5 | 03_failure_modes/ — the 9 production failure patterns |
| 6 | Run Labs 01–03 — naive → hybrid → reranker, hands-on |
| 7 | 00_overview/system_design_principles.md + a mock system design round |
| Week | Focus |
|---|---|
| 1 | Core concepts (01_concepts/) + Labs 01–02 |
| 2 | Full interview bank (02_interview_bank/) — all 52 architectures |
| 3 | Failure modes + 08_evaluation/ + Labs 03–04 |
| 4 | Agentic RAG deep dive (01_concepts/agentic_orchestration.md) + Lab 05 + mock interviews using the Interactive Quiz Site |
Content types:
Getting Started (00_overview/) — Roadmap, taxonomy, learning path, and system design principles for orientation
Core Concepts (01_concepts/) — Reference material, mostly not Q&A
Interview Questions (02_interview_bank/) — 22 questions per architecture
[Basic] [Intermediate] [Advanced][Scenario] tag (e.g. `[Advanced]` `[Scenario]`) — use the quiz's "Scenario only" filter to drill just theseFailure Modes (03_failure_modes/) — 10 questions per failure pattern
Labs (06_labs_py/) — 5 runnable notebooks turning the Q&A into working pipelines
See Study Plans above for how to sequence these under time pressure.
Embeddings · Chunking strategies · Vector databases (FAISS, Pinecone, Weaviate, pgvector) · Hybrid search (BM25 + dense) · Reranking & cross-encoders · RAG evaluation (RAGAS, NDCG) · Agentic RAG · Graph RAG · Self-RAG & Corrective RAG · Multi-modal RAG · Text-to-SQL · Prompt injection & RAG security · Hallucination mitigation · LLM observability · Multi-tenancy & access control · Knowledge graph construction · Semantic caching · Cost optimization · Privacy-preserving retrieval · Streaming / real-time indexing · Citation & attribution · ColBERT multi-vector retrieval · Reasoning RAG & RL-trained search (Search-R1) · Deep Research agents · Vision-native RAG (VisRAG)
This repo grows best with real-world signal. If you were asked a RAG question in an interview, open an issue or a PR — real questions are prioritized over synthetically generated ones.
See CONTRIBUTING.md for the format, and CODE_OF_CONDUCT.md for community guidelines.
For issues, questions, or general feedback:
See Contributing to add your interview experience to the repo.