RAG Retrieval Quality Interview Questions

Reviewed by Mark Dickie · Last updated

RAG retrieval quality is the measure of how accurately and completely a retrieval-augmented generation system surfaces the right context for a given query. For AI engineering interviews, you should know the trade-offs between chunking strategies, the role of hybrid search (dense + sparse), how cross-encoder reranking improves precision, and the standard evaluation metrics (recall@k, nDCG, MRR). Interviewers also expect you to reason about failure modes like irrelevant chunks polluting the prompt, low recall from poor embedding choices, and stale or duplicated context.

Below is a quick map of the core topics you will be tested on:

TopicWhat to KnowCommon Interview Angle
ChunkingFixed-size, sentence-aware, and semantic chunking; overlap windowsWhen does overlap help and when does it hurt?
EmbeddingsDense vector models, dimensionality, domain-specific vs generalWhich embedding would you pick for legal text and why?
Hybrid searchCombining BM25 sparse retrieval with dense vector searchHow do you fuse ranked lists from two retrievers?
RerankingCross-encoders vs bi-encoders; latency trade-offsWhy rerank the top-50 instead of reranking everything?
Evaluationrecall@k, precision@k, nDCG, MRR; offline test setsHow do you know retrieval improved after a change?

What does a RAG retrieval quality interview test?

Most questions fall into three areas: making retrieval more precise (fewer irrelevant chunks), making it more complete (no missed passages), and measuring whether a change actually helped. You may be asked to walk through a system design where you pick a retrieval pipeline and justify each choice, or you may get a debugging scenario where the model hallucinates because retrieval returned garbage.

How do you evaluate retrieval quality before looking at generation?

Retrieval is only as good as the evaluation loop behind it. A typical preparation checklist:

  1. Build a labeled evaluation set of query–passage pairs drawn from your real corpus, not a generic benchmark.
  2. Run your retriever and compute recall@k to check whether the gold passage appears in the top-k results.
  3. Measure nDCG to account for ranking quality, not just presence.
  4. Log precision@k to catch cases where the pipeline floods the context with irrelevant chunks.
  5. Compare metrics across pipeline variants (different chunk sizes, embedding models, or fusion strategies) before shipping any change to production.

What chunking and overlap decisions matter most?

Chunk size directly controls how much surrounding context each retrieved unit carries. Small chunks (128–256 tokens) give precise matches but can split key information across boundaries. Large chunks (512–1024 tokens) preserve context but dilute relevance signals and cost more tokens in the prompt. Overlap helps when the answer spans a boundary, but excessive overlap wastes storage and can introduce duplicate retrieval hits. Sentence-aware chunking, which breaks at natural boundaries, is the practical default most interviewers look for before you argue for anything fancier.

Key facts

  • Tarmac has 28 AI Engineering interview questions on this topic, 10 of them on this page, at difficulty 1–5 of 5.
  • Tarmac tracked 4,175 job postings asking for AI Engineering in August 2026.
  • Roles asking for AI Engineering advertise a median base salary of US$180,000, across 757 job postings as of August 2026.
  • Tarmac last reviewed these AI Engineering interview questions on 7 September 2026.

At a glance

Questions10 shown · 28 in the bank
Difficulty1–5 of 5
FormatsMultiple choice, True / false, Fill in the blank, Ordering, Multiple answer, Short answer, Find the bug

What you'll review

  1. retrieval quality
  2. embeddings

Practice questions

Try one before you open the answer. Pick an option and press Check; it's marked on the spot.

AI Engineering/rag/retrieval-quality

In a Retrieval-Augmented Generation (RAG) pipeline, which metric is most directly used to measure whether the retrieved chunks actually contain the information needed to answer the user's question?#

Options

Show answer

Context Recall (retrieval recall) is the metric most directly used to measure whether retrieved chunks contain the information needed to answer a question. It quantifies how much of the ground-truth answer is covered by the retrieved documents. BLEU, perplexity, and throughput measure generation quality, model uncertainty, and speed respectively — not retrieval coverage.

Why:

Context Recall measures whether the retrieved chunks contain all the pieces of information required to answer the query — i.e., how much of the ground-truth answer is covered by the retrieval set. BLEU measures text similarity between generated and reference text, perplexity measures a language model's uncertainty, and throughput is a latency/performance metric, none of which directly evaluate retrieval coverage.

AI Engineering/rag/retrieval-quality

In a RAG system, increasing the number of retrieved chunks (top-k) always improves the quality of the final generated answer.#

Options

Show answer

False. Increasing top-k does not always improve answer quality. While a higher k boosts the chance of retrieving relevant content, it also floods the context with noisy or irrelevant chunks, which can confuse the language model and degrade its response. The best approach is to tune top-k to balance retrieval recall against context precision.

Why:

Increasing top-k does not always improve answer quality. While a higher k increases the chance of retrieving relevant chunks (improving recall), it also introduces more irrelevant or noisy chunks into the context window. This can confuse the language model, dilute the relevant signal, and even cause the model to ignore key information — a phenomenon sometimes called 'lost in the middle'. The optimal k balances recall and precision.

AI Engineering/rag/retrieval-quality

In RAG retrieval quality, _____ measures the fraction of retrieved chunks that are relevant to the query, while _____ measures the fraction of all relevant chunks that were successfully retrieved.#

Show answer

In RAG retrieval quality, precision measures the fraction of retrieved chunks that are relevant to the query, while recall measures the fraction of all relevant chunks that were successfully retrieved.

Why:

Precision and recall are the two fundamental retrieval quality metrics. Precision = (relevant retrieved) / (total retrieved), telling you how much of what was fetched is actually useful. Recall = (relevant retrieved) / (total relevant), telling you how much of the available useful information was found. A good RAG system needs both: low precision means noisy context, low recall means missing key information.

AI Engineering/rag/retrieval-quality

In a RAG system, increasing the chunk size (i.e., making each retrieved passage longer) always improves retrieval quality because larger chunks contain more context.#

Options

Show answer

False — increasing chunk size does NOT always improve retrieval quality. Larger chunks dilute the dense vector embedding, making it harder to match specific queries precisely and reducing retrieval precision. The chunk size is a critical hyperparameter that involves a trade-off: smaller chunks improve specificity but may lack context, so practitioners often use hybrid strategies like hierarchical or 'small-to-big' chunking.

Why:

Increasing chunk size is a trade-off, not a guaranteed improvement. Larger chunks can dilute the dense vector representation, causing the embedding to capture a broad mix of topics rather than the specific content relevant to a query. This lowers retrieval precision: the retrieved chunk may contain the answer but also a lot of irrelevant content, reducing the signal-to-noise ratio. Smaller, focused chunks often yield higher precision, while a hybrid approach (e.g., 'small-to-big' retrieval or hierarchical chunking) is commonly used to balance precision and context.

AI Engineering/rag/retrieval-quality

A RAG system is built in the following stages. Place these activities in the correct chronological order for a typical offline indexing pipeline (i.e., before any user query is issued):#

Put these in order

Show answer

The correct offline RAG indexing order is: (1) raw documents arrive from a data source, (2) documents are split into chunks, (3) an embedding model converts each chunk's text into a dense vector, (4) vectors, chunk text, and metadata are upserted into a vector database, (5) an approximate nearest-neighbor index is built on the stored vectors. Each step strictly depends on the output of the previous one, so the total order is uncontested.

Why:

Each stage strictly depends on the output of the one before it. You must first ingest raw documents (A) before you can split them (B). You can only embed chunk text after chunks exist (C). The vectors, text, and metadata are upserted into the vector store as a single operation once the embeddings are produced (D). Finally, the ANN index is built on the already-stored vectors so that similarity search can be performed at query time (E). No pair of adjacent steps can be reordered without breaking a hard data dependency.

AI Engineering/rag/retrieval-quality

A production RAG system returns factually correct answers but frequently includes irrelevant passages in the retrieved context, which occasionally causes the LLM to hallucinate or contradict itself. Which of the following interventions most directly target retrieval precision (filtering out irrelevant passages from the context sent to the LLM)?#

Options

Pick every one that applies.

Show answer

The interventions that most directly target retrieval precision (filtering irrelevant passages from LLM context) are: cross-encoder reranking (re-scores candidates with full query-passage attention), metadata pre-filtering (narrows the candidate pool to relevant document types/recency before vector search), and similarity score thresholding (discards low-confidence chunks). Larger chunks reduce precision; HyDE targets recall, not precision.

Why:

Cross-encoder rerankers (a) re-score each candidate passage with full query–passage attention, directly targeting precision by surfacing only the most relevant chunks for the LLM context. Metadata pre-filtering (c) narrows the candidate pool to semantically plausible documents before vector search, eliminating irrelevant domains entirely—assuming the filter criteria are aligned with the query's intent so that relevant documents are not accidentally excluded. A similarity score threshold (e) acts as a precision gate, discarding low-confidence passages from the final context sent to the LLM—though thresholds must be tuned per corpus since bi-encoder scores are not well-calibrated across queries. Larger chunks (b) reduce precision by packing more off-topic content into each passage, making the problem worse rather than better. HyDE (d) generates a hypothetical document to improve embedding alignment for underspecified queries, targeting recall rather than precision; it does not filter irrelevant passages and may even surface additional false positives if the synthetic document drifts from the true answer.

AI Engineering/rag/retrieval-quality

In a dense-retrieval RAG setup you measure two metrics on a held-out evaluation set:#

Show answer

High Recall@10 means the correct passage is almost always somewhere in the top-10 results, and a solid MRR@10 means it is usually ranked near the top — so coverage and ranking are not the primary problem. The drop in faithfulness despite good retrieval metrics suggests the new embedding model returns passages that are topically related but subtly off-target (e.g., similar domain, different entity or time period), causing the LLM to generate answers that are not grounded in the actual retrieved text. Two concrete diagnostic steps: (1) Inspect a random sample (~50) of low-faithfulness responses, compare the retrieved chunks to the generated answer, and look for consistent patterns (wrong entity, stale date, paraphrasing hallucination). (2) Run a chunk-level attribution analysis — for each generated claim, check whether it can be traced back to a specific span in the retrieved context; a high 'ungrounded claim' rate points to the embedding model returning plausible-looking but factually misaligned passages.

Why:

High Recall@10 and MRR@10 confirm that the correct passage is being retrieved and ranked well, so the failure is not a coverage or ranking problem. The faithfulness drop after an embedding model change strongly implies the new model retrieves semantically adjacent but factually divergent passages — a qualitative mismatch invisible to rank-based metrics. Good answers identify this nuance and propose attribution-level or qualitative inspection steps rather than simply reverting the model blindly.

AI Engineering/llm-foundations/embeddings

Documents were indexed with one embedding model, but retrieval returns near-random results. Which line is the bug?#

const DOC_MODEL = "text-embedding-3-large";

async function indexDocs(docs: string[]) {
  const res = await openai.embeddings.create({ model: DOC_MODEL, input: docs });
  await store.upsert(res.data.map((d, i) => ({ id: i, vector: d.embedding, text: docs[i] })));
}

async function search(query: string) {
  const res = await openai.embeddings.create({ model: "text-embedding-3-small", input: query });
  return store.query(res.data[0].embedding, { topK: 5 });
}
Show answer

The bug is on line 9.

Why:

Line 9 embeds the query with text-embedding-3-small while the documents were indexed with text-embedding-3-large (line 1/4). Different embedding models produce vectors in different, incompatible spaces — they have different dimensionalities and geometry, so cosine similarity between a small-model query vector and large-model document vectors is meaningless. The query must be embedded with the exact same model (and version) used to build the index. The fix is to reuse DOC_MODEL on line 9.

AI Engineering/rag/retrieval-quality

A production RAG pipeline retrieves from a 10-million-document corpus using a single-stage dense retriever (bi-encoder). Evaluation shows high recall@100 but poor precision@5, causing LLM hallucinations from irrelevant context. Which of the following changes are most likely to improve precision@5 without unacceptably degrading recall@100? Select all that apply.#

Options

Pick every one that applies.

Show answer

The two changes most likely to improve precision@5 without hurting recall@100 are: (A) adding a cross-encoder reranker over the bi-encoder's top-100 candidates, and (B) fine-tuning the bi-encoder with hard-negative mining on in-domain data. The reranker deeply scores each candidate against the query, lifting ranking quality within the already-retrieved set. The fine-tuned bi-encoder learns tighter decision boundaries for the target domain.

Why:

A cross-encoder reranker (option A) scores each of the top-100 candidate passages against the full query jointly, dramatically improving ranking precision without changing recall@100 because the recall set is untouched. Fine-tuning the bi-encoder with hard negatives on in-domain data (option B) directly teaches the embedding model to separate relevant from near-miss documents, lifting both precision and recall. Option C reduces ef_search, which shrinks the ANN candidate set and hurts recall@100 — the opposite of desired. HyDE (option D) can improve recall for ambiguous queries but does not selectively improve precision and may introduce noise from hallucinated hypothetical docs. Increasing chunk size (option E) often hurts precision because a large chunk is more likely to contain irrelevant passages that dilute relevance scoring.

AI Engineering/rag/retrieval-quality

In a RAG system, you observe that retrieval MRR (Mean Reciprocal Rank) is high (≈0.85) on your dev set but end-to-end faithfulness scores (measured by an LLM judge) remain below 0.5. The retriever returns the right passage in first position most of the time. Describe two distinct root causes that could explain this gap and, for each, name one concrete metric or diagnostic you would compute to confirm it.#

Show answer
  1. Context window stuffing / lost-in-the-middle: Even when the relevant passage is retrieved at rank 1, the pipeline concatenates multiple chunks into the prompt and the LLM systematically ignores information that appears in the middle of a long context. Diagnostic: Run an ablation that feeds only the rank-1 chunk (no other retrieved passages) to the LLM and measure faithfulness; if it jumps significantly, the issue is positional neglect. Metric: per-position faithfulness breakdown (faithfulness conditioned on the relevant chunk's position in the prompt). 2. Passage-level relevance vs. answer-level sufficiency mismatch: The passage is topically relevant (so MRR is high) but does not actually contain the specific evidence needed to ground the answer — e.g., it mentions the entity but not the precise fact requested. Diagnostic: Compute answer recall (does the gold answer string appear in the retrieved passage?) separately from MRR; a high MRR + low answer recall confirms this. Alternatively, measure context relevance vs groundedness using RAGAS framework metrics to isolate where faithfulness breaks down.
Why:

A high MRR means the relevant document is found, but faithfulness can still fail for at least two independent reasons. First, LLMs exhibit 'lost-in-the-middle' behaviour (Liu et al., 2023): when multiple retrieved chunks are concatenated, information not at the very beginning or end is often ignored, causing the model to generate unfaithful completions even when the right chunk is present. Second, retrieval relevance is a coarser signal than answer sufficiency — a chunk can be on-topic but lack the exact supporting evidence, leading the LLM to hallucinate the missing detail. Both are diagnosable with targeted ablations and decomposed metrics (e.g., RAGAS splits context relevance from answer faithfulness and groundedness).

Related interview questions

Job market

See ai-engineering salaries and hiring demand from live job postings.

The other 18 questions

This page shows 10 and marks what you pick. That's as far as a page can go. A free account opens the other 18 and keeps every answer. What you miss comes back until it's right: after a day, then at longer gaps.

Start with this topic

Free · the whole bank · 100 marked answers per 30 days · written feedback on the paid plan

What moved, monthly

One email a month when the bulletin comes out: what moved in the markets we track, and the new question topics we published. Confirm your address to join. Unsubscribe any time.