CrackML by @ml.with.umang
Interview questions / GenAI & LLM
GenAI & LLM interview question

Explain how RAG works end to end.

Explain how RAG works end to end. Structure your response as you would in a top-tier ML/AI engineering interview.

mediumconceptEvidence 75/1001 source reportMicrosoft

The 60-second answer

Define the knowledge boundary, chunking strategy, metadata, embeddings, and retrieval/index design. Separate retrieval quality from generation quality: measure recall/precision or nDCG, then faithfulness, citation correctness, task quality, safety, latency, and cost.

Build the answer in this order

1
Define the mechanism

Define the knowledge boundary, chunking strategy, metadata, embeddings, and retrieval/index design.

2
Explain the architecture

Separate retrieval quality from generation quality: measure recall/precision or nDCG, then faithfulness, citation correctness, task quality, safety, latency, and cost.

3
Compare trade-offs

Add reranking, evidence-aware prompting, insufficient-evidence fallbacks, and trace retrieval/model behavior for debugging.

4
Close with serving + evaluation

Test prompt injection, stale data, permissions, and corpus/model/version changes before production rollout.

A useful interview mental model

This is the shape of a strong answer—not a script to memorize.

01Definition
02Mechanism
03Trade-offs
04Failure modes
05When to use

Senior-level signal

  • Version corpus, embeddings, reranker, prompt, and model independently so regressions are attributable and reversible.
  • For enterprise RAG, enforce authorization before retrieval and evaluate leakage/exfiltration attacks as first-class failure modes.

What the interviewer is really testing

Understanding beyond prompting: architecture, retrieval, evaluation, inference, safety, latency, cost, and failure recovery.

Likely follow-up questions

What assumption makes this approach work?
When would you choose the strongest alternative instead?
What production or data failure mode changes your answer?

Common weak-answer patterns

  • Reciting a definition without mechanism or assumptions.
  • Claiming one technique is always better without a data regime.
  • Stopping before failure modes, validation, or deployment implications.