Embeddings interview questions
7 questions across 2 sections, in the order you would learn them. Every answer here is one that works — but an answer you have read is not an answer you can give, so use Test yourself and say it out loud first.
Turning meaning into coordinates
Read the section that teaches thisIf this comes up in an interview
What is an embedding?
A vector representing a piece of text, positioned so that text with similar meaning lands nearby. It converts semantic similarity into geometric distance, which makes similarity searchable.
Why cosine similarity rather than Euclidean distance?
Cosine measures the angle and ignores magnitude, so it compares direction of meaning rather than length of text. Euclidean distance would let a long document score differently from a short one saying the same thing.
Can you compare embeddings from two different models?
No. Each model has its own space, so the numbers are not comparable. Changing embedding model means re-embedding the entire corpus, which is why the choice is worth a little thought up front.
Where embedding search fails
Read the section that teaches thisIf this comes up in an interview
Why does embedding search sometimes return irrelevant results?
It measures topical similarity, not whether a passage answers the question. Text about the right subject scores highly even when it contains nothing useful. It also loses exact terms like product codes, which is why hybrid search exists.
What is hybrid search?
Running keyword and vector search together and fusing the results, usually by rank rather than raw score since the two scoring scales are incomparable. Keyword catches exact terms, vector catches paraphrase.
What does a reranker do?
It scores each candidate against the query directly rather than comparing pre-computed vectors, which is more accurate and much slower. You use it to reorder a shortlist, never to search a whole corpus.
Your RAG system returns wrong answers. How do you debug it?
Check recall first: was the correct document in the retrieved set at all? If not, the problem is chunking or embedding. If it was retrieved but ranked low, the problem is ranking, and reranking or hybrid search will help. Only if retrieval was correct is it a generation problem.
Then they push further
The right chunk was retrieved but the answer is still wrong. Now what?
The problem is in generation. Check that the chunk was in the context the model actually saw and not trimmed away, whether it was buried among irrelevant chunks, and whether the prompt tells the model to rely on the context. Then read the answer against the chunk to see if it misread a number or blended two sources.
The right chunk was never retrieved. What next?
Find out why. Try the question as a keyword search to see if the words match at all, check how that document was parsed and chunked, and check whether the question uses different words from the document. Hybrid search, better chunking and query rewriting each fix a different one of these.
How do you stop it coming back?
Add the question to the retrieval eval with the chunk it should find, and to the answer eval with the expected answer. Measure retrieval separately from answer quality so you know which stage regressed.
What gets marked up. Strong answers split the problem into retrieval and generation and check which failed before changing anything. Jumping straight to a new embedding model or a bigger model is marked down.
These are the questions for one topic. The whole question bank covers every topic on the site.