All jobs / AI engineer / RAG — Retrieval-Augmented Generation
AI engineer interview question · 0–1 years
Walk me through a RAG system, from a document being uploaded to a user getting an answer.
The strongest answer
Two pipelines. Ahead of time: parse, chunk, embed and index the documents. At question time: retrieve the closest chunks, put them in the prompt, and have the model answer from them with sources. The weights never change
Why it works
Exactly — ingestion and answering are separate pipelines, and many RAG bugs live in the first one. Nothing is trained: the knowledge arrives in the prompt.
What a good answer covers
- Two pipelines: ingest, then answer.
- Parse, chunk, embed, index.
- Retrieve, assemble the prompt, generate, cite.
- Nothing is trained; knowledge is in the prompt.
Answers that fall short
- Close, but not the strongest: The question is embedded, the closest chunks come back, and the model answers using them
That is the question-time half. The half that parses, chunks and indexes is where a lot of the quality is won or lost. - Weak: The uploaded documents are used to train the model, so afterwards it knows the company’s data
RAG does not train anything. The model reads retrieved text at question time, which is why updating a document updates the answers. - Red flag: I would plug in a framework’s default chain; what it does inside is not something I need to know
Frameworks are fine; not knowing what yours does is not. You cannot debug a pipeline you cannot describe.
Who gets asked this
More RAG — Retrieval-Augmented Generation questions
- Why do we split documents into chunks before embedding them, instead of making one vector per document?
- What is chunk overlap for, and what does too much of it cost?
- Users paste the error code “E-4012” into the support assistant. It returns passages about errors in general…
- A policy document was updated yesterday and the assistant still quotes the old text, with a citation. Where…
- Why does that happen, and what do you do about it?
- The assistant gave a wrong answer to a question the documentation clearly covers. How do you find out which…
- The right chunk is nearly always in your top 50 results but rarely in the 5 you send to the model. What do…
- You own the RAG system. What do you ask for before this merges?