Core to Deep Dive
Revise retrieval pipelines, chunking, reranking, grounding, evaluation, and common production failure modes.
Depth
Showing 4 of 4 questions
Short answer
A basic pipeline ingests and chunks documents, creates searchable representations, retrieves candidates for a query, optionally reranks them, builds a bounded context, generates an answer, and returns citations or evidence.
Interview-ready answer
I divide the system into offline indexing and online serving. Indexing handles parsing, chunking, metadata, embeddings or lexical indexes, versioning, and deletion. Serving rewrites or classifies the query, applies authorization filters, retrieves and reranks candidates, selects context within a token budget, generates with grounding instructions, and records retrieval and answer metrics. Each stage needs observable inputs and outputs for debugging.
Common mistakes
Short answer
Chunking determines the unit that can be found and placed in context, while reranking improves the order of retrieved candidates using a more precise relevance signal. Small chunks improve precision but can lose context; large chunks add context but increase noise and token cost.
Interview-ready answer
I choose chunk boundaries based on document structure and expected questions, then measure retrieval recall at a generous candidate depth. A reranker can recover precision by scoring query-document pairs more carefully than the first-stage retriever, but it adds latency and cost. I tune chunk size, overlap, candidate count, reranker depth, and final context assembly together because optimizing one stage in isolation can reduce end-to-end grounded answer quality.
Common mistakes
Short answer
Faithfulness asks whether claims are supported by supplied evidence, answer relevance asks whether the response addresses the query, context precision measures how much retrieved context is useful, and context recall measures whether required evidence was retrieved.
Interview-ready answer
I evaluate retrieval before generation using labeled relevant documents, recall at k, precision, and ranking metrics. Then I evaluate the answer for supported claims, completeness, citation correctness, and usefulness. Model judges can scale semantic evaluation, but I calibrate them against human labels and keep deterministic checks for citations, access control, and known facts. Segmenting failures prevents a generation fix from masking a retrieval problem.
Common mistakes
Short answer
Correct context does not guarantee that the model attends to it, resolves conflicts, follows grounding instructions, or avoids adding unsupported prior knowledge. Context may also be poorly ordered, overloaded, ambiguous, or vulnerable to injected instructions.
Interview-ready answer
I would inspect whether the needed evidence survived context assembly, where it appears, whether other chunks conflict, and whether the prompt clearly requires evidence-backed claims. Long or noisy context can dilute attention, and retrieved documents can contain prompt injection. Mitigations include better context selection and ordering, claim-level citations, constrained answer formats, explicit abstention, injection isolation, and faithfulness evaluation. The trace must preserve retrieved and final context, not just document IDs.
Common mistakes