Tech_Interview_Prep

Retrieval-Augmented Generation (RAG)

Grounding an LLM's output in retrieved external documents instead of relying purely on its trained-in knowledge.

Q1.What is the primary purpose of the retrieval step in a RAG pipeline?

Q2.Why are documents split into chunks before embedding, rather than embedding whole documents?

Q3.What does an embedding model output for a piece of text?

Q4.What is "cosine similarity" used for in a RAG pipeline?

Q5.Which of the following is a sparse retrieval method, as opposed to dense embedding-based retrieval?

Q6.What is "hybrid search" in the context of RAG?

Q7.What problem does a re-ranking step (e.g. a cross-encoder) solve after initial retrieval?

Q8.What is a common tradeoff of a cross-encoder re-ranker compared to bi-encoder embedding retrieval?

Q9.What is "chunk overlap" and why is it used?

Q10.What does HNSW stand for, and what is it used for?

Q11.Why do vector databases use approximate nearest neighbor (ANN) search instead of exact search?

Q12.What is the main risk of setting the retrieval "top-k" value too low?

Q13.What is the main risk of setting "top-k" too high?

Q14.What does "faithfulness" measure in RAG evaluation?

Q15.What is HyDE (Hypothetical Document Embeddings)?

Q16.Why might query rewriting be used before retrieval?

Q17.What is a common cause of a RAG system giving a confidently wrong answer despite correct retrieval?

Q18.What is "metadata filtering" in a RAG retrieval pipeline?

Q19.Why does RAG generally reduce hallucination compared to relying on the model's parametric knowledge alone?

Q20.What does "retrieval recall" measure in RAG evaluation?

Q21.Which of the following best describes "multi-hop" retrieval questions?

Q22.What is a key advantage of RAG over fine-tuning for keeping an LLM's knowledge current?

Q23.What is "context window packing" concerned with in RAG?

Q24.Why might placing the most relevant retrieved chunk in a specific position (e.g. start or end) of the prompt matter?

Q25.What is "Graph RAG"?