All jobs / AI engineer / RAG — Retrieval-Augmented Generation

AI engineer interview question · 3–5 years

In a multi-turn chat about leave policy, the user asks “and what about for contractors?”. Retrieval returns unrelated passages.

Why does that happen, and what do you do about it?

The strongest answer

The follow-up is not a standalone query; embedded alone it carries no topic. I rewrite it into a self-contained question using the conversation — a cheap model call — retrieve on that, and log the rewrites

Why it works

Exactly — retrieval sees only the query string, not the chat. A rewrite step restores what the user meant, and because it can also get it wrong, you log it and evaluate it.

What a good answer covers

Answers that fall short

Who gets asked this

More RAG — Retrieval-Augmented Generation questions