Skip to content
RED SAGSkills
easyAI Engineer (LLM & Generative AI) interview question

How does vector search work, and why is it useful for an AI application?

What the interviewer wants to hear

  • Text is turned into embeddings that capture meaning
  • Documents are embedded once and stored in an index
  • The query is embedded with the same model and compared by similarity
  • Approximate nearest-neighbour indexes make search fast at scale
  • It finds matches by meaning, but can miss exact terms like codes

Model answer

Vector search finds text by meaning rather than exact words. First I split documents into chunks and run each through an embedding model, which turns it into a list of numbers where similar meanings end up close together. These vectors go into an index, often a vector database. At query time I embed the question with the same model and ask the index for the nearest vectors, usually by cosine similarity or dot product. Approximate nearest-neighbour structures such as HNSW make this fast even with millions of chunks. It is useful because a question like "how do I get my money back" can match a section titled "refund policy". Its weakness is exact terms like error codes or names, so I often combine it with keyword search.

Can you answer it under time pressure?

Take a timed easy round and get scored on every answer.

Start mock interview

More easy AI Engineer (LLM & Generative AI) questions