AI EngineeringInterview preparation
Intermediate·Concept·2 min read

RAG

Practice this question

Beginner — What is RAG?

  • RAG retrieves relevant external evidence and gives it to a model before answering.
  • It lets the insurance assistant use current private policy documents and produce source-backed explanations instead of relying only on learned knowledge.

Intermediate — RAG or long context?

  • If the task already identifies a small permitted document set, long context may be simpler.
  • For a large changing corpus, retrieval selects relevant evidence more efficiently.
  • Both need access control, applicability checks, and answer evaluation.

Senior — How do you debug wrong RAG answers?

  • I inspect parsing, document version and permissions, chunk boundaries, candidate recall, ranking, supplied context, and answer support in that order.
  • I score retrieval and generation separately, then improve the failing stage rather than automatically using a larger model.

Scenario — An answer cites a real document but is wrong. Why?

  • The cited document may be irrelevant, expired, inapplicable, or missing an exception; the answer may also misinterpret it.
  • I validate source eligibility and claim support, not just whether the link exists.
Adapted from 13_AI.MD · “29.3 RAG”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.