RAG (Retrieval-Augmented Generation) interview questions and answers
10 questions from the RAG (Retrieval-Augmented Generation) Interview Mock practice bank, spread across its domains. Pick your answer, then open the explanation to see why each option is right or wrong.
- Question 1Foundations and Indexing
A team considers switching from recursive splitting to embedding-based semantic chunking. Which are real costs or failure modes to plan for? (Choose two.)
Choose 2.
- A
It needs no tuning, because thresholds are learned automatically
- B
It cannot be used with OpenAI embedding models
- C
Ingest needs an embedding call for every sentence or sentence window, on top of embedding the final chunks
- D
Chunk lengths vary widely, so a maximum size is needed to stop very long chunks forming
- E
It always beats recursive splitting on retrieval recall and precision
Show the answer and explanation
Answer: C and D
Semantic chunking can produce more coherent chunks, but it costs more at ingest, produces uneven lengths and is sensitive to its threshold. Chroma's study found its default variant underperformed, while a variant with a maximum chunk length did better. Evaluate it against a tuned recursive baseline before switching.
Why the other options are wrong
A. The breakpoint threshold, window size and maximum length all need tuning per corpus.
B. Any embedding model can compute the sentence distances.
E. Chroma found the default Kamradt semantic chunker slightly below average on all metrics; results depend on parameters.
- A
- Question 2Retrieval and Ranking
What happens to BM25 scoring as you change
k1?- A
Larger
k1increases length normalisation, penalising long documents more - B
k1scales IDF, so a larger value makes rare terms count more - C
k1sets how many documents BM25 returns - D
Larger
k1delays saturation;k1 = 0makes a term present-or-absent
Show the answer and explanation
Answer: D
k1controls non-linear term-frequency saturation (Elasticsearch default 1.2),bcontrols length normalisation (default 0.75). Raisingk1gives more credit to documents that repeat a term; lowering it toward 0 treats a term as simply present or absent.Why the other options are wrong
A. Length normalisation is controlled by
b, notk1.B. IDF is computed from document frequencies;
k1only shapes the term-frequency curve.C. The number of results is the top-k of the search request, unrelated to
k1.
- A
- Question 3Generation and Evaluation
You are deciding whether a new prompt template is better using an offline golden set scored by an LLM judge. Which two practices make the comparison trustworthy? (Choose two.)
Choose 2.
- A
Show the judge which version produced each answer so it can focus on the new one
- B
Score old and new versions on the same questions with the same pinned judge model and prompt, and compare per question
- C
Regenerate a fresh synthetic golden set for each candidate so the prompt cannot overfit it
- D
Rerun the baseline a few times to measure run-to-run noise, and treat smaller differences as no change
- E
Compare the new score with last quarter's dashboard figure, which used an older judge version
Show the answer and explanation
Answer: B and D
Treat evaluation like an experiment: fixed questions, fixed and blind judge, paired per-question comparison, and an estimate of noise before you claim a win. Read the regressions by slice even when the average improves.
Why the other options are wrong
A. Revealing the source invites bias; judges should be blind to which system wrote the answer.
C. Different questions per candidate make scores incomparable; overfitting is handled with a held-out split, not a moving test set.
E. Changing the judge changes the ruler; the two numbers are not comparable.
- A
- Question 4Advanced Patterns and Production
A RAG request has this cost profile: 1,000 tokens of system prompt plus 12 chunks of 500 tokens as input, 400 output tokens, an LLM priced at $3 per million input tokens and $15 per million output tokens, a 20-token query embedding at $0.02 per million tokens, and a rerank call at $2 per 1,000 searches. Which line item dominates, and what is the matching lever?
- A
Output tokens, about 72% of the cost; cap answers at 100 tokens
- B
Query embedding, about 30% of the cost; cache query embeddings
- C
Reranking, about 50% of the cost; drop the reranker
- D
Input tokens, about 72% of the cost; send fewer, better chunks
Show the answer and explanation
Answer: D
Per request: input 7,000 x $3/M = $0.021; output 400 x $15/M = $0.006; rerank $0.002; query embedding about $0.0000004. Total about $0.029, of which input context is about 72%. In most RAG systems the retrieved context dominates the bill, so trimming chunks (with an evaluation showing quality holds) and caching a repeated prompt prefix are the first levers, not re-embedding.
Why the other options are wrong
A. 400 output tokens cost $0.006, about 21%. Output is pricier per token, but input volume is far larger here.
B. 20 tokens at $0.02 per million is $0.0000004 per request, a negligible share.
C. The rerank call costs $0.002 of the roughly $0.029 per request, about 7%, so removing it saves little and costs quality.
- A
- Question 5Foundations and Indexing
To save space you slice stored
text-embedding-3-smallvectors to their first 512 values yourself instead of using thedimensionsparameter, and keep using a dot-product index. Recall drops more than you expected. What did you miss?- A
Slicing changes the model's tokenizer, so queries must be re-tokenised
- B
You must also slice the query vector to its last 512 values
- C
Dot-product indexes require at least 1,024 dimensions
- D
Sliced vectors are no longer unit length; re-normalise them after slicing
Show the answer and explanation
Answer: D
Embeddings returned at full size are unit length, but a prefix of a unit vector is shorter than 1 (for a random 3,072-dimension unit vector, the first 256 values have norm of about 0.27). Different chunks lose different amounts of length, so dot-product scores get distorted. The
dimensionsparameter returns a properly normalised shortened vector; if you slice yourself, apply L2 normalisation afterwards.Why the other options are wrong
A. Slicing a stored vector has nothing to do with tokenisation.
B. Query and documents must use the same leading dimensions; taking the last values mixes different coordinates.
C. There is no such requirement; dimension counts are a storage and quality trade-off.
- A
- Question 6Retrieval and Ranking
Adaptive-RAG labels its training queries automatically: if the no-retrieval strategy answers correctly the label is no-retrieval; if it fails but both single-step and multi-step succeed, the label is single-step. Why prefer the simpler strategy in a tie?
- A
Simpler strategies are always more accurate than multi-step retrieval
- B
The router should pick the cheapest strategy that still answers correctly
- C
Multi-step retrieval cannot be run on questions that come from single-hop datasets
- D
The classifier can only output two labels, so one of the strategies must be merged away
Show the answer and explanation
Answer: B
Adaptive-RAG (Jeong et al., 2024) trains a small LM (T5-Large) to predict query complexity, choosing between no retrieval, single-step and multi-step retrieval. Ties go to the simpler strategy, and queries that every strategy fails are labelled by dataset origin (single-hop datasets as single-step, multi-hop as multi-step). The routing objective is accuracy at the lowest cost.
Why the other options are wrong
A. Not true in general; multi-step retrieval wins on genuinely multi-hop questions. The tie-break applies only when both succeed.
C. Multi-step retrieval can run on any question; it is just slower and more expensive.
D. Adaptive-RAG's classifier predicts three labels: no retrieval, single-step and multi-step.
- A
- Question 7Generation and Evaluation
Ragas context precision is 1.0 on a question, yet the answer is incomplete. Five chunks were retrieved: the first is useful, the other four are not, and the reference answer needs facts from four different chunks. How can context precision be 1.0?
- A
It must be a judge error, because four irrelevant chunks always give a score of 0.2
- B
It averages precision only at the positions of useful chunks retrieved, so one useful chunk at rank 1 scores 1.0
- C
Context precision measures answer completeness, so the judge decided the answer was complete
- D
Ragas ignores chunks after the first unless
kis set explicitly
Show the answer and explanation
Answer: B
Context precision rewards ranking useful chunks first; context recall measures whether all the needed evidence came back. Report them together, the same way you would never report precision without recall.
Why the other options are wrong
A. Plain precision@5 would be 0.2, but Ragas context precision is rank-weighted over useful chunks only, so 1.0 is the correct computation.
C. It judges retrieved chunks, not the answer's completeness.
D. Every retrieved chunk is judged; the irrelevant ones simply add nothing to the numerator or denominator.
- A
- Question 8Advanced Patterns and Production
A semantic cache is implemented like this in a multi-tenant RAG assistant:
def cached_answer(query: str): v = embed(query) hit = cache.nearest(v) # one shared cache for all tenants if hit and hit.score >= 0.95: return hit.answer return NoneWhat is the most serious flaw?
- A
Cosine similarity is the wrong measure for comparing query embeddings
- B
The lookup is not scoped by tenant or permissions, so one tenant can receive an answer built from another's documents
- C
Embedding the query on every request costs more than the cache saves
- D
A threshold of 0.95 is too strict, so the hit rate will be low
Show the answer and explanation
Answer: B
A cached answer is derived from documents the original asker was allowed to see. The cache key or lookup filter must therefore include the tenant and permission scope, and usually the corpus or index version and the prompt and model version too, so that changes do not serve answers produced under the old ones. Without that, the cache becomes a cross-tenant data leak that bypasses the retrieval filter entirely.
Why the other options are wrong
A. Cosine similarity is a standard choice for comparing query embeddings; the measure is not the problem.
C. A query embedding is cheap compared with retrieval plus generation; it does not cancel out the savings.
D. A strict threshold lowers the hit rate but is the safe direction; it is not the serious flaw here.
- A
- Question 9Foundations and Indexing
A bank indexes every policy in English and Hindi. Top-5 results often contain both language versions of the same clause, wasting slots, and Hindi-speaking users must see cited Hindi text. Which ingest-time change best fixes this?
- A
Translate every Hindi document into English before indexing, so only one language remains in the index
- B
Raise top-k from 5 to 10 so duplicates matter less
- C
Tag each chunk with language and a translation-group id; filter by language and collapse groups
- D
Delete the Hindi documents, since most users read English
Show the answer and explanation
Answer: C
Parallel-language corpora behave like duplicate documents at retrieval time, especially with multilingual embeddings that place translations close together. Capturing language and a translation-group key at ingest gives retrieval enough information to filter by language and de-duplicate across translations.
Why the other options are wrong
A. Citations would point to machine-translated English, not the official Hindi text the users need.
B. Duplicates still take slots and context budget; the waste just moves.
D. That breaks the requirement that Hindi users get cited Hindi text.
- A
- Question 10Retrieval and Ranking
A multi-query retriever runs 4 query variants and gets 4 ranked lists of chunks, with heavy overlap between them. How should the lists be combined before generation?
- A
Concatenate the four lists in order and send all 40 results to the model
- B
Keep only chunks that appear in every one of the four lists, since agreement signals relevance
- C
Average the raw similarity scores of each chunk across lists, treating a missing chunk as score 0
- D
Union the lists, deduplicate by chunk id and order the result with a rank fusion such as RRF
Show the answer and explanation
Answer: D
Multi-query improves recall by searching with several phrasings; the merge must preserve that gain. The usual recipe is union, dedupe by chunk id, then rank fusion (reciprocal rank fusion is the common default, as in RAG-Fusion) or a reranker over the merged set. The cost is one extra LLM call plus N retrievals, which can run in parallel.
Why the other options are wrong
A. Concatenation keeps duplicates and gives the first variant's list priority purely by position, wasting context on repeated chunks.
B. Intersection throws away exactly the extra recall that multi-query was added for; a chunk found by one good paraphrase is lost.
C. Treating absence as zero punishes chunks a single paraphrase found, and raw scores are not always comparable across queries. Rank-based fusion avoids both issues.
- A
Practise all 450 RAG (Retrieval-Augmented Generation) questions
Start with the free 15-question diagnostic. It shows where to focus, and your results carry over if you sign up.