Skip to content
Preptima

Embeddings & Vector Indexes interview questions

What an embedding encodes, HNSW and IVF trade-offs, recall versus latency, dimensionality and quantisation, and re-embedding after a model change.

3 questions in RAG, Retrieval & Agents.

medium1

mediumConcept

What does a text embedding encode, and what does it fail to encode?

An embedding places text in a space where distance approximates the similarity its training data taught it. It does not encode relevance, and it represents exact identifiers, negation and numeric constraints so weakly that dense retrieval alone is unreliable wherever those decide the answer.

4 minmid, senior, staff

hard2

hardConceptDesign

How do you choose between a flat index, IVF and HNSW for vector search?

Flat search is exact and scales linearly, so it suits small collections and supplies ground truth for the rest. IVF trades recall for speed by probing a subset of clusters, HNSW does it with a graph at higher memory and build cost, and in both recall is a parameter you set rather than inherit.

5 minmid, senior, staff
hardScenarioDesign

A better embedding model has come out. What does moving to it cost you?

Vectors from two models live in unrelated spaces, so there is no incremental path — you re-embed and reindex the whole corpus. The real cost is running both indexes side by side long enough to compare them on a gold set, keeping query and document models in step, and retuning thresholds calibrated on the old scores.

5 minmid, senior, staff