# RAG Fundamentals Quiz

## Question 1

What does RAG stand for and what problem does it solve?

A) Random Algorithm Generation — generates random code
B) Retrieval-Augmented Generation — grounds LLM answers with retrieved documents
C) Recursive Auto-Regression — a type of model training
D) Real-time Annotation Gateway — data labeling tool

<!-- ANSWER: B -->
<!-- EXPLANATION: RAG (Retrieval-Augmented Generation) retrieves relevant documents, augments the prompt with them, and generates answers grounded in that context. It addresses LLM knowledge cutoff and hallucination. -->

## Question 2

What do embeddings represent?

A) Compressed versions of documents
B) Numerical vectors that capture semantic meaning; similar text → similar vectors
C) Encryption keys for secure storage
D) Token counts for pricing

<!-- ANSWER: B -->
<!-- EXPLANATION: Embeddings map text to vectors in a high-dimensional space. Semantically similar texts produce similar vectors, enabling similarity search. -->

## Question 3

Drag the RAG pipeline steps into the correct order:

<!-- VISUAL: quiz-drag-order -->

A) Docs → Chunk → Embed → Store → Query → Embed → Retrieve → Augment → Generate
B) Query → Retrieve → Chunk → Embed → Generate
C) Embed → Chunk → Store → Retrieve → Generate
D) Chunk → Query → Embed → Retrieve → Augment → Generate

<!-- ANSWER: A -->
<!-- EXPLANATION: Indexing: Docs → Chunk → Embed → Store. Query: Query → Embed → Retrieve (from store) → Augment prompt → Generate. -->

## Question 4

Which chunking strategy preserves meaning boundaries best?

A) Fixed-size only
B) Semantic (e.g., by paragraph or section)
C) Random split
D) Single chunk per document

<!-- ANSWER: B -->
<!-- EXPLANATION: Semantic chunking splits on natural boundaries (paragraphs, sections) so each chunk is a coherent unit. Fixed-size can split mid-sentence. -->

## Question 5

What does "re-ranking" do in RAG?

A) Re-trains the embedding model
B) Re-ranks retrieved chunks with a second pass to improve precision before sending to the LLM
C) Reorders user queries by priority
D) Restores deleted chunks

<!-- ANSWER: B -->
<!-- EXPLANATION: Re-ranking takes the top-k retrieved chunks and uses a cross-encoder or LLM to re-score them, improving which chunks are passed to the generator. -->

## Question 6

Which is a common RAG pitfall?

A) Using too few chunks (e.g., top-1 only)
B) Stuffing too much context into the prompt, diluting relevance
C) Using keyword search instead of embeddings
D) Evaluating with too many metrics

<!-- ANSWER: B -->
<!-- EXPLANATION: Stuffing too much retrieved context can add noise, exceed context limits, and dilute the most relevant information. Tune top-k and use re-ranking. -->
