All jobs / AI engineer / RAG — Retrieval-Augmented Generation
AI engineer interview question · 3–5 years
The assistant gave a wrong answer to a question the documentation clearly covers. How do you find out which stage of the pipeline failed?
The strongest answer
Follow that query’s trace stage by stage: is the passage in the index and parsed properly? Was it retrieved? Did it survive reranking and the context budget? If it reached the prompt and was ignored, it is generation
Why it works
Exactly — a RAG answer can fail at ingestion, retrieval, assembly or generation, and each has a different fix. The trace tells you which; guessing fixes the wrong one.
What a good answer covers
- Find the stage before the fix.
- Indexed? Retrieved? Kept? Used?
- Read the trace for that query.
- Confirm the fix on the eval set.
Answers that fall short
- Close, but not the strongest: Look at the retrieved chunks: if they look right, work on the prompt; if not, work on retrieval
A good first split, but it misses the ends: a passage mangled at parsing was never retrievable, and one cut by the context budget was retrieved but never seen. - Weak: Lower the temperature so that the model stops making things up
Temperature does not help if the right passage never reached the prompt. Find the stage before turning dials. - Red flag: Swap in a stronger model and retry that one question; if it passes, ship the change
One passing retry proves nothing, and a bigger model will happily answer from the same missing context. Diagnose, then test on the eval set.
Who gets asked this
More RAG — Retrieval-Augmented Generation questions
- 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?
- Leadership wants one assistant over all internal documents — HR, legal, finance, engineering — for every…
- Since you added “answer only from the retrieved context, otherwise say you don’t know”, the assistant refuses…
- Walk me through a RAG system, from a document being uploaded to a user getting an answer.
- 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…