Embeddings & Retrieval · 3 to 4 hours
Design hybrid retrieval within a latency budget
Design hybrid retrieval with reranking for a multi-tenant help center, choose a configuration from measured quality and latency gates, and keep access rules intact through timeouts and model migrations.
4 h
Overview
Design and tune hybrid retrieval and reranking under quality, latency, access, and freshness constraints. A strong interview answer explains how candidates enter and leave the pipeline, how quality is measured at each stage, and what happens when a component times out. Detailed ingestion and answer-generation design belong to RAG & Data Pipelines.
Study time: 3 to 4 hours
Interview format: System design discussion with measured gates
By the end you can
- Separate the three sizes in a retrieval pipeline and explain where a relevant item can be lost
- Compute reciprocal rank fusion and nDCG, and say what each does not measure
- Distinguish approximate-index recall from task relevance recall, and tune each with the right experiment
- Select a configuration from measured gates and name the evidence still missing
- Keep access rules intact under timeouts, caches, and post-filtering
- Plan an embedding migration that switches query encoding and the index together
Prerequisites
Helpful background: Familiarity with percentiles, evaluation datasets, and service design helps.
This topic finds and ranks candidates. RAG & Data Pipelines covers ingestion, grounding, citations, and the document lifecycle.
In this guide
- Frame the retrieval problem
- Candidate generation, fusion, and reranking
- Fusion parameters and candidate coverage
- Approximate search and representation quality
- Reranker constraints
- Latency budget and deadlines
- Access filters, caches, and freshness
- Evaluation design
- Worked selection scenario
- Check each configuration against the gates
- Model and index migration
Hard questions are part of Premium: the study guide, reference answer, rubric, and exercises unlock with Premium.
Related on CodeSnatch
Lessons, problems, and articles that build the skills this question uses.
System Design
Runs BM25 and vector retrieval in parallel, fuses them with reciprocal rank fusion before a rerank, and reindexes by alias swap.
System Design
Splits retrieval into stages with their own candidate counts and latency budgets, and compares pre- and post-filtered ANN.
Practice problem
Practice choosing the documents a user may see from trusted identity alone, across tenant and group rules.
AI Engineering
Practice recommending one option from measured quality, cost, and latency, and naming the evidence still missing.
AI Engineering
Continues the migration story after a failed backfill: versioned indexes, a paired encoder and index switch, and a cutover gate.
Practice the interview question
Answer it in your own words before you look at the reference answer.
