Loading…
Vector search questions cover embeddings, similarity metrics, approximate nearest neighbour indexes and the retrieval layer underneath RAG systems.
Vector search is the retrieval layer of modern AI applications: text is embedded into vectors, and finding relevant content becomes finding nearby vectors. Interview questions range from implementing cosine similarity and brute-force search by hand, to designing an approximate nearest neighbour index that keeps latency acceptable at scale.
The trade-off interviewers want named is recall against latency — approximate indexes are approximate on purpose, and a candidate who treats them as exact has not run one. Expect follow-ups on how vectors are kept current when source documents change, on filtering by metadata alongside the similarity search, and on why normalising vectors makes cosine similarity equivalent to a dot product.
3 system design · 8 coding · 2/6/3 easy/medium/hard
Cosine is the usual default for text embeddings because it compares direction rather than magnitude. On normalised vectors it is equivalent to a dot product, which is why production systems normalise once at write time.
When the corpus outgrows an in-memory brute-force scan, or when you need metadata filtering, incremental updates and persistence together. Below that, a straightforward index inside an existing database is often enough.