Ingestion parses documents, cleans them, splits them into chunks that keep their headings, and stores each chunk with an embedding and metadata such as source, date and permissions. At query time you may rewrite the question, retrieve candidates with vector and keyword search, filter by permissions, rerank, and pass the best few chunks to the model with instructions to answer only from them and cite sources.
Why interviewers ask this
RAG is the default architecture for most LLM products, so the interviewer wants to see that you know it is a pipeline with several places to fail, not a vector database bolted onto a prompt. They listen for parsing quality, metadata and access control, the split between retrieval and generation, and whether you would measure each stage separately. Mentioning permissions at retrieval time shows you have thought about real company data.
How to structure your answer
- Cover ingestion: parsing, cleaning, chunking and metadata.
- Explain the query path: rewriting, hybrid retrieval and reranking.
- Describe how the prompt grounds the answer and asks for citations.
- Close with how you evaluate retrieval and generation separately.
Example answer
I think of it as two pipelines. The offline one is ingestion, and it is where most quality problems start. Parsing matters more than people expect, because a PDF with tables and headers turns into soup if you just extract raw text. So I parse with structure, strip boilerplate like navigation and footers, and chunk along headings, keeping the section title on each chunk so it still makes sense alone. Every chunk gets an embedding plus metadata: source, last updated date, and who is allowed to see it. The online pipeline starts with the question. Sometimes I rewrite it, turning a follow up like what about contractors into a standalone query. Then I run vector and keyword search together, filter by the user's permissions before anything reaches the model, and rerank the top fifty or so down to five. The prompt tells the model to answer only from those passages, cite them, and say when the answer is not there. Scoring retrieval and answers separately on my last build showed that most bad answers came from bad retrieval.
Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.
See how it worksFollow-up questions to expect
- How would you keep the index in sync when documents change or get deleted?
- Where exactly would you enforce document permissions, and why there?
- How do you decide how many chunks to put in the prompt?
Related ai engineer questions
Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.
Predict my questions