Interview Q&A / AI & Generative AI

INTERVIEW Q&A · 61 QUESTIONS

AI & Generative AI interview questions

LLMs, tokens, embeddings, RAG and prompt engineering, the questions every AI role now asks.

  1. How do you decide how many chunks (top-k) to retrieve in RAG?

    Too few chunks risk missing the answer. Too many add noise, raise cost and can bury the useful passage. Choose k by measuring recall and answer quality on test questions, and often retrieve many, rerank, and pass only a handful to the model.

    BeginnerQuick answer1 min read
  2. What is a vector database, and how is it different from a normal database?

    A vector database stores embeddings and finds the ones nearest to a query vector quickly, using specialised indexes. A normal database finds rows by exact values or ranges. Vector search finds similar meaning, not equal values.

    BeginnerQuick answer1 min read
  3. What is chunk overlap, and why is it used?

    Overlap repeats a small slice of text at the end of one chunk at the start of the next. It prevents a sentence or idea cut at a boundary from being split with no chunk containing it whole, at the cost of some duplicated storage.

    BeginnerQuick answer1 min read
  4. Why do we split documents into chunks before indexing them for RAG?

    Embedding a whole long document blurs many topics into one vector, and passing it all to the model wastes context. Chunks are small enough that each vector represents one idea, so retrieval can return only the relevant passages.

    BeginnerQuick answer1 min read
  5. Why must you use the same embedding model for documents and queries?

    Each embedding model builds its own vector space, with its own dimensions and meaning for every number. Vectors from different models are not comparable, so mixing them gives meaningless similarity scores, or fails if the sizes differ.

    BeginnerQuick answer1 min read