Skip to content
Preptima

RAG, Retrieval & Agents interview questions

Retrieval-augmented generation end to end: ingestion, embeddings and vector indexes, hybrid search and reranking, retrieval evaluation, permissions, and agentic tool use.

21 published across 7 topics.

RAG, retrieval and agents fundamentals58 short answers on one page, for revising rather than studying.

Parsing real documents, chunk size and overlap as a retrieval decision, preserving structure and metadata, and handling tables and scans.

mediumConceptDesign

How do you choose a chunking strategy for a document corpus?

Chunk boundaries decide what can ever be retrieved, so you derive them from the questions the corpus must answer and from the document's own structure, then confirm the choice with retrieval recall on a gold set rather than by eye.

4 minmid, senior, staff
hardDesignScenario

Your corpus is scanned PDFs, spreadsheets and slide decks. How do you ingest it?

Route each format to a parser that respects its structure, treat OCR output as text with a confidence score rather than as truth, convert tables into rows that carry their headers, and record a section path and stable anchor per chunk so every retrieved passage can be cited back to a place in the original.

6 minmid, senior, staff
mediumConceptDesign

What metadata do you store alongside each chunk, and what is each field for?

Each chunk needs its source document and version, its section path, an anchor precise enough to open, effective and ingestion dates, and the permission set that governed the original — because filtering, citation, freshness and access control are all served from metadata rather than from the vector.

4 minmid, senior, staff
All 3 in Ingestion & Chunking

What an embedding encodes, HNSW and IVF trade-offs, recall versus latency, dimensionality and quantisation, and re-embedding after a model change.

hardConceptDesign

How do you choose between a flat index, IVF and HNSW for vector search?

Flat search is exact and scales linearly, so it suits small collections and supplies ground truth for the rest. IVF trades recall for speed by probing a subset of clusters, HNSW does it with a graph at higher memory and build cost, and in both recall is a parameter you set rather than inherit.

5 minmid, senior, staff
hardScenarioDesign

A better embedding model has come out. What does moving to it cost you?

Vectors from two models live in unrelated spaces, so there is no incremental path — you re-embed and reindex the whole corpus. The real cost is running both indexes side by side long enough to compare them on a gold set, keeping query and document models in step, and retuning thresholds calibrated on the old scores.

5 minmid, senior, staff
mediumConcept

What does a text embedding encode, and what does it fail to encode?

An embedding places text in a space where distance approximates the similarity its training data taught it. It does not encode relevance, and it represents exact identifiers, negation and numeric constraints so weakly that dense retrieval alone is unreliable wherever those decide the answer.

4 minmid, senior, staff
All 3 in Embeddings & Vector Indexes

Why dense retrieval alone misses exact terms, combining BM25 with vectors, fusion strategies, and where a cross-encoder reranker earns its latency.

hardConceptDesign

Where does a cross-encoder reranker earn the latency it costs you?

It earns it when your gold set shows recall at 50 is much better than recall at 5, because that gap is what reranking converts into answer quality. The cost is a model pass per candidate with nothing precomputable, so the latency budget divided by measured per-batch cost sets the candidate count.

5 minmid, senior, staff
All 3 in Hybrid Search & Reranking

Building a gold set from real questions, recall at k versus end-answer quality, groundedness and citation checks, and diagnosing which stage failed.

mediumConceptDesign

How do you build a gold set for a retrieval system?

Source the questions from real users and from randomly sampled documents rather than from the team, label each with a quotable answer string anchored to a document rather than a chunk id so the set survives re-chunking, and hold part of it back so you are not tuning against your own measurement.

5 minmid, senior, staff
mediumConceptDesign

Which metrics tell you whether retrieval is working?

Recall at k is the primary one, since a passage that never reaches the prompt cannot be used; precision at k measures wasted window; MRR or NDCG measure ordering. Read them beside the groundedness of the answer, because high recall with bad answers points at generation or context ordering.

4 minmid, senior, staff
All 3 in Retrieval Evaluation

Incremental updates and deletes, propagation lag, reindexing without downtime, and keeping an index honest about what no longer exists.

mediumConceptDesign

How do you keep a retrieval index current as the underlying documents change?

Detect change at the source rather than by re-crawling everything, upsert at document granularity so moved chunk boundaries do not orphan rows, propagate deletions as explicit tombstones the query filter respects, and publish the source-to-searchable lag as a measured SLA.

5 minmid, senior, staff
All 3 in Freshness & Incremental Indexing

Enforcing per-user permissions inside retrieval, tenant isolation in a shared index, and why post-filtering a result set is the wrong place to start.

hardScenarioDesign

A user's access to a document set is revoked. What has to happen across your RAG stack?

Revoke once in the authorisation store, then propagate to the index ACLs, every cache holding text or results, any derived summaries and embeddings, and the conversation transcripts still carrying passages. Answers already delivered cannot be recalled, so the guarantee you offer is a bounded window rather than erasure.

6 minsenior, staff, lead
hardConceptDesign

How do you enforce per-user permissions in a retrieval system?

Carry the authorised principal set on every chunk and pass the user's principals into the search as a filter, so the candidate set is legal before ranking. Filtering after retrieval leaks through counts and gaps, and destroys recall for the users with the narrowest access.

6 minmid, senior, staff
hardDesignConcept

How do you isolate tenants in a shared vector index?

Choose between an index per tenant, per-tenant namespaces and one filtered index by weighing recall, blast radius and per-tenant fixed cost. Partitioning turns tenant selectivity from a search-quality problem into a routing decision, which is the argument most candidates miss.

5 minsenior, staff, lead
All 3 in Access Control & Multi-tenancy

Tool calling and schema design, planning loops and step budgets, idempotency and retries, handing control back to a human, and when an agent is the wrong shape.

hardDesignScenario

How do you stop an agent from looping or running away?

Enforce step, token, wall-clock and monetary budgets in the orchestrator rather than in the prompt, detect repetition and lack of progress as separate conditions, and require an approval bound to specific arguments before any irreversible action. Exhausting a budget should hand back partial work, not vanish.

5 minmid, senior, staff
hardDesignConcept

When is an agent the wrong shape for a problem?

Whenever you can draw the flowchart. A fixed pipeline with a model at the two steps needing judgement is cheaper, testable and debuggable, and per-step error compounds across a planning loop. Reach for an agent when the tool sequence is open-ended and the environment verifies the work.

5 minmid, senior, staff, lead
hardDesignConcept

How do you design the tools an agent calls?

Give each tool one narrow purpose with a self-describing schema, return failures as structured results the model can act on rather than raising, take an idempotency key on anything that mutates, and put validation and authorisation in the executor because arguments produced by a model are untrusted input.

5 minmid, senior, staff
All 3 in Agents & Tool Use