RAG fundamentals and retrieval
Build evidence-aware generation pipelines.
Retrieve source passages, rerank candidates and cite supporting evidence.
Interview questions
Choose a question to reveal its answer.
01EasyCoreHow do you choose document chunk boundaries in RAG?
Answer
How do you choose document chunk boundaries in RAG?
Splits documents into retrieval units with suitable boundaries and possible overlap.
A useful chunk must carry enough context to answer likely queries but not so much irrelevant material that retrieval loses precision. Evaluate chunk size, boundaries and overlap on representative retrieval queries. Keep document identifiers for citations and permission filtering.
Divide a long policy document into section-aware passages.
02EasyCoreHow are embeddings used for document retrieval?
Answer
How are embeddings used for document retrieval?
Maps inputs to vector representations that support similarity operations.
Encode a question and document chunks into compatible vectors.
import numpy as np
q = np.array([1., 0.])
docs = np.array([[1., 0.], [0., 1.]])
scores = docs @ q / (np.linalg.norm(docs,axis=1)*np.linalg.norm(q))
print(scores.argsort()[::-1])Toy dense retrieval over nonzero vectors; production uses trained embeddings.
03EasyCoreWhy use a vector index for nearest-neighbor search?
Answer
Why use a vector index for nearest-neighbor search?
Data structure for efficient nearest-neighbor search over embeddings.
Retrieve semantically similar passages without scanning all documents.
04MediumHigh priorityHow does BM25 rank documents?
Answer
How does BM25 rank documents?
Lexical ranking method using term frequency, inverse document frequency and length normalization.
Retrieve an exact product identifier from text.
05MediumHigh priorityVisualWhy combine lexical and dense retrieval?
Answer
Why combine lexical and dense retrieval?
Combines lexical and semantic retrieval signals.
Lexical search captures exact identifiers and rare keywords, while dense retrieval helps with semantic paraphrases. Combine rankings through a defined fusion method such as reciprocal rank fusion; tune and evaluate the hybrid system against both component baselines.
Find exact keywords and paraphrases in one search pipeline.
06MediumWhat is reranking and why is it useful?
Answer
What is reranking and why is it useful?
Reorders an initial candidate set using a more precise relevance signal.
Score query-passage pairs after approximate retrieval.
07MediumHow do metadata filters improve retrieval?
Answer
How do metadata filters improve retrieval?
Restricts candidate documents using structured attributes.
Retrieve only documents from the requested year.
08MediumHow do you assemble context within a token budget?
Answer
How do you assemble context within a token budget?
Selects and formats retrieved evidence within a model token budget.
Deduplicate passages and include source identifiers.
09HardHow do you ground generated answers in retrieved evidence?
Answer
How do you ground generated answers in retrieved evidence?
Generates an answer conditioned on relevant source evidence.
Respond using a policy passage and reference its section.
10HardHow do you measure retrieval recall at a fixed cutoff?
Answer
How do you measure retrieval recall at a fixed cutoff?
Fraction of relevant items retrieved, given a relevance set and cutoff.
Check whether top ten passages contain known supporting documents.
Priority and difficulty are editorial study recommendations.
Technical reference: Documentation / paper ↗
Try a few practice questions
Explore the questions before creating a free account.
1. Which retrieval method is particularly useful for exact rare identifiers?
2. A relevant passage appears at rank 8. Recall@5 for one known relevant passage is what?
3. What is the primary purpose of a reranker?
Advanced RAG and CRAG
Continue to the next set of interview questions.