AI Engineer Interview Question

When would you add keyword search or a reranker on top of vector search?

What the interviewer is probing, how to structure your answer, and a spoken example you can adapt.

Quick answer

Add keyword search when queries contain exact terms that embeddings handle poorly, such as product codes, error messages, names and acronyms. Running both and merging the lists, often with reciprocal rank fusion, usually beats either alone. Add a reranker when the right passage appears in the top fifty but not the top five. A cross encoder scores each query and passage together, which is more accurate but slower, so you run it only on a shortlist.

Why interviewers ask this

Pure vector search is the tutorial default, and the interviewer wants to know whether you have seen where it fails. They listen for concrete failure cases like identifiers and rare terms, a sensible method for combining result lists, and a clear reason why a reranker beats the first stage on accuracy. Checking recall at a larger depth before adding a reranker shows that you diagnose a problem before adding components to fix it.

How to structure your answer

  • Name the query types where embeddings struggle.
  • Explain hybrid retrieval and how you merge the lists.
  • Explain what a reranker does differently and what it costs.
  • Say how you would measure whether each one helps.

Example answer

Spoken example, first person

I add keyword search as soon as I see queries with exact strings in them. Embeddings are good at meaning and surprisingly poor at things like an error code, a part number or a surname, because those carry little semantic signal. On a support assistant I worked on, searches for specific error codes kept returning loosely related troubleshooting pages instead of the one page that mentioned the code. Adding a keyword index alongside the vectors and merging the two ranked lists with reciprocal rank fusion fixed most of that. A reranker solves a different problem. I compare recall at fifty with recall at five, and if the right passage is usually in the fifty but not the five, the first stage is finding it but ranking it badly. A cross encoder reads the query and each passage together, so it judges relevance far better than comparing two separately computed vectors, but it is too slow to run over the whole index. So retrieval casts a wide net, the reranker picks the best handful, and I watch the latency it adds.

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 works

Follow-up questions to expect

  • How would you tune the balance between keyword and vector results?
  • How much latency would a reranker add, and how would you keep it acceptable?
  • How do metadata filters interact with approximate vector search?

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

Rehearse the hard questions before they are asked

Practise with a live copilot, then walk in ready. A $29 Session Pass gets you through the interview with no subscription and no lock-in.

Get GhostPilot