Skip to content

RAG Interview Questions

Questions on building and debugging retrieval augmented generation systems, from chunking to evaluation.

mathshian•5 Nov 2026
RAG retrieves relevant documents at query time and gives them to the model as context so it can answer from current, specific information. It avoids retraining when knowledge changes and allows answers to cite their sources.
Document ingestion and cleaning, chunking, an embedding model, a vector or hybrid index, a retriever, an optional re-ranker, prompt construction with the retrieved context, the generator and an evaluation and monitoring layer.
Chunk along natural structure such as headings, paragraphs or table rows rather than fixed sizes alone. Include small overlaps and attach metadata such as title and section. Test several sizes on your own questions, since the best choice depends on document type and query style.
Vector search captures meaning but can miss exact terms such as product codes, names or acronyms. Keyword search such as BM25 catches those. Combining both and merging results usually improves recall.
A re-ranker scores the top retrieved candidates against the query with a more accurate model, then keeps the best few. It is worth adding when the right passage is often retrieved but ranked too low, at the cost of extra latency.
Separate retrieval from generation. Check whether the right passage was in the retrieved set, then whether it was in the prompt, then whether the model used it. Common causes are chunks that split the answer, outdated documents, contradictory sources and prompts that do not tell the model to rely on the context.
Measure retrieval and generation separately. For retrieval use recall at k and ranking quality on a labelled question set. For generation measure faithfulness to the context, answer correctness and relevance. Add human review of a sample and track results over time.
Faithfulness is whether every claim in the answer is supported by the retrieved context. Measure it by breaking the answer into claims and checking each against the sources, using a validated model-based grader or human reviewers.
Store access control metadata with each chunk and filter at retrieval time based on the user's identity. Filtering after generation is too late. Test with users who should and should not see specific documents.
Use incremental ingestion triggered by change events or scheduled syncs, track document versions and delete or update stale chunks. Monitor index age and run checks that known recent documents are retrievable.
Use layout-aware parsing to preserve structure, convert tables into a readable format with headers kept with each row and use OCR for scans while checking its error rate. Parsing quality often limits RAG quality more than the model does.
When the corpus is small enough to fit in the context, queries need reasoning across the whole document and cost and latency are acceptable. RAG remains better for large or changing corpora, cost control and source citations.