All jobs / AI engineer / RAG — Retrieval-Augmented Generation
AI engineer interview question · 5+ years
Leadership wants one assistant over all internal documents — HR, legal, finance, engineering — for every employee.
What is the first design constraint you raise?
The strongest answer
Permissions. Retrieval must enforce each user’s access at query time: access metadata on every chunk, synced from the source systems, filtered server-side before anything reaches the prompt — including revocations and deletions
Why it works
Exactly — a model cannot keep a secret it has been handed. What a user may not open must never be retrieved for them, and access changes in the source have to reach the index.
What a good answer covers
- A model cannot keep a secret.
- Enforce access at retrieval, server-side.
- Mirror source permissions on every chunk.
- Propagate revocations and deletions.
Answers that fall short
- Close, but not the strongest: Build a separate index per department and route each user to the index for their department
Right instinct, too coarse: access is per document and per person, and it crosses departments. It has to mirror the source systems’ permissions. - Weak: Instruct the model in the system prompt never to reveal confidential material to the wrong people
A prompt is not an access control. Once the text is in the context, a rephrased question can get it out. - Red flag: Index everything first to prove adoption, and add the permission layer in phase two
Phase one would let any employee ask for salaries and legal files. A leak in the pilot ends the project — and it should.
Who gets asked this
More RAG — Retrieval-Augmented Generation questions
- 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…
- 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…