Interview Q&A · questions with model answers
RAG Interview Questions
Part of the study plan for: Native AI Engineer · Forward Deployed Engineer (FDE)
Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.
-
Most asked RAG leaf: How do you measure retrieval quality independently of generation?
Retrieval quality is measured independently of generation by building labeled query-document relevance sets and computing standard information retrieval metrics such as Recall@k, Mean Reciprocal…
-
Most asked RAG leaf: How do you prevent prompt injection via retrieved documents?
Prompt injection via retrieved documents is prevented by treating all retrieved content as untrusted data, using input/output guardrails, separating system instructions from retrieved context, and…
-
Most asked RAG leaf: How do you evaluate faithfulness of answers?
Faithfulness of RAG answers is evaluated by checking whether every claim in the generated answer is supported by the retrieved source documents. This is measured using LLM-as-judge evaluations,…
-
Most asked How do you choose a chunking strategy for RAG?
Choosing a chunking strategy for RAG depends on your document structure, query patterns, and retrieval method. The main strategies are fixed-size chunking, recursive/semantic chunking, and…
-
Most asked How do you enforce permissions and tenant isolation in RAG?
Permissions and tenant isolation in RAG are enforced by attaching access control metadata to every chunk at index time and applying mandatory filters at query time that restrict results to only what…
-
Most asked How do you make RAG answers grounded and verifiable?
RAG answers are made grounded and verifiable by (1) instructing the LLM to cite specific source chunks for every claim, (2) including only retrieved context in the prompt (never allowing the model…
-
Most asked How do you evaluate a RAG system?
A RAG system is evaluated across three dimensions: retrieval quality (are the right documents found?), generation quality (is the answer faithful, relevant, and well-written?), and end-to-end…
-
Most asked RAG leaf: How do you choose top-k and context budget?
Choosing top-k and context budget in RAG involves balancing retrieval recall (finding all relevant chunks) against the LLM's ability to process and focus on the most relevant content. Typical…
-
RAG leaf: How would you RAG over tables and structured data?
RAG over tables and structured data requires converting tables into a format that both embeddings and LLMs can reason about. Common approaches include text-to-SQL generation, table serialization…
-
RAG leaf: How do you ingest PDFs with complex layouts?
Ingesting PDFs with complex layouts (multi-column, tables, headers/footers, images with captions) requires layout-aware parsing that preserves document structure. Tools like PDF parsing libraries…
-
RAG leaf: How do you A/B test a new embedding model?
A/B testing a new embedding model in RAG requires running both the old and new models in parallel, comparing retrieval quality using offline evaluation metrics (recall@k, nDCG) and online metrics…
-
RAG leaf: What SLOs would you set for a customer-facing RAG assistant?
Key SLOs for a customer-facing RAG assistant include latency (p95 time-to-first-token and total response time), answer quality (faithfulness score and relevance), availability (uptime percentage),…
-
How do you assemble retrieved chunks into a good prompt?
Assembling retrieved chunks into a good prompt involves ordering chunks by relevance, adding source labels for citation, providing clear instructions to the LLM about how to use the context,…
-
How would you choose a vector store for a new RAG project?
Choosing a vector store for a new RAG project depends on scale (thousands vs. billions of vectors), operational requirements (managed vs. self-hosted), feature needs (hybrid search, metadata…
-
How do you choose chunk size and chunking strategy for RAG?
Chunk size trades off context completeness vs retrieval precision.
-
What causes hallucinations in RAG systems, and how do you reduce them?
Hallucinations persist when retrieval misses relevant docs, context is noisy/contradictory, the prompt doesn't constrain grounding, or the model ignores context.