Practiced one out loud? Paste your answer into the free self-check and get a score in 30 seconds
What the interviewer is testing
Whether you understand the bi-encoder vs cross-encoder difference and can place a re-ranker in a pipeline with sensible candidate counts and latency.
Answer framework
- Retrieve wide and cheap: get a candidate set, for example the top 50, from vector, keyword or hybrid search.
- Re-score each candidate with a model that reads the query and the passage together, usually a cross-encoder or an LLM.
- Keep the top 5 to 10 for the prompt.
- Explain why: a cross-encoder sees query and passage jointly, so it judges relevance better than comparing two separately computed embeddings.
- Manage cost: it is too slow for the whole corpus, so tune the candidate count against latency.
Sample answer
Retrieval with embeddings uses a bi-encoder: the query and each document are embedded separately and compared with a similarity score. That is fast enough to search millions of chunks, but each vector is a compressed summary, so the ranking is approximate.
Re-ranking adds a second stage. I take a wide candidate set, say the top 50 from hybrid search, and score every query-passage pair with a cross-encoder, which reads both texts together and can notice whether the passage actually answers the question, including negations and specific conditions. Then I keep the best 5 to 10 for the prompt.
The cost is latency, since the cross-encoder runs once per candidate. I tune the candidate count by looking at recall at 50 versus 100 from the first stage and the re-ranker's latency on our hardware. Putting the strongest passages first also helps because models use the start of the context more reliably.
Likely follow-ups
Common mistakes
- Re-ranking only the top 5, which leaves the re-ranker nothing to fix.
- Running a cross-encoder over the whole corpus.
- Not measuring first-stage recall, which caps what re-ranking can achieve.
- Ignoring the added latency in user-facing flows.
The 0 to 1 AI Engineer Interview Playbook covers the answer frameworks, system-design walkthroughs and an 8-week plan.
Get the playbook 40% off with code EARLYBF until Nov 3, 11:59 PM PTEARLYBF: 40% off until Nov 3Smaller start: Score your answers against 50 rubrics, $9. 50 AI engineer questions, one rubric each, PDF on Gumroad.
Interviewing for PM or TPM? See the full PM package, $59 on Gumroad: a resume system, a PM, TPM and PGM interview handbook, a 1:1 cheat sheet and a PM playbook. PM and TPM content, not AI engineer prep.
Related questions
Based on question #29 in the full question bank.