Skip to content
RED SAGSkills
mediumAI Engineer (LLM & Generative AI) interview question

How do you measure the retrieval part of a RAG system separately from the generation part?

What the interviewer wants to hear

  • Build a labelled set of queries with known relevant chunks
  • Use recall@k to check the right chunks are retrieved
  • Use MRR or nDCG to check ranking quality
  • Evaluate generation separately for faithfulness and correctness
  • Track metrics per change: chunking, embeddings, hybrid, reranking

Model answer

I split the evaluation in two. For retrieval I build a labelled set of real queries, each mapped to the chunks or documents that contain the answer, often with help from domain experts or by generating questions from known passages and reviewing them. Then I compute recall@k, because the model cannot use a chunk that was never retrieved, and MRR or nDCG to see whether good chunks rank near the top. Precision@k tells me how much noise goes into the prompt. For generation I separately check faithfulness to the retrieved context and answer correctness, using rubric-based judges calibrated on human labels. Keeping them apart tells me where to fix things: if recall is low I work on chunking, embeddings, hybrid search or reranking; if recall is fine I work on the prompt or model.

Can you answer it under time pressure?

Take a timed medium round and get scored on every answer.

Start mock interview

More medium AI Engineer (LLM & Generative AI) questions