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. What is retrieval-augmented generation (RAG), and when would you use it?

    RAG first retrieves relevant passages from your own data, then gives them to the LLM along with the question so it answers from that material. Use it when answers must come from private, large or frequently changing information the model was not trained on.

    IntermediateIn-depth3 min read
  2. How do you choose chunk size in a RAG system?

    Small chunks give precise matches but may lose surrounding context. Large chunks keep context but dilute the embedding and waste prompt space. Pick a starting size from the document type, then tune it by measuring retrieval quality on real questions.

    IntermediateQuick answer1 min read
  3. How do you make a RAG system cite its sources?

    Store a source id with every chunk, pass the chunks to the model with labels, and instruct it to cite the labels it used. Then check in code that each cited id was actually retrieved and ideally that the claim is supported by that chunk.

    IntermediateQuick answer1 min read
  4. How does metadata filtering improve retrieval?

    Chunks are stored with fields such as source, date, language, product or access level. Filtering on those fields before or during vector search removes irrelevant or forbidden documents, improving precision and enforcing who is allowed to see what.

    IntermediateQuick answer1 min read
  5. In RAG evaluation, what is the difference between faithfulness and answer relevance?

    Faithfulness asks whether every claim in the answer is supported by the retrieved context. Answer relevance asks whether the answer actually addresses the user's question. An answer can be faithful but off-topic, or on-topic but unsupported.

    IntermediateQuick answer1 min read
  6. What is hybrid search, and why combine keyword and vector search?

    Hybrid search runs keyword search such as BM25 and vector search together and merges the rankings. Vector search catches meaning and paraphrases, while keywords catch exact terms like product codes, names and rare jargon that embeddings can miss.

    IntermediateQuick answer1 min read
  7. What is reranking in RAG, and why add it after retrieval?

    Reranking takes the top candidates from fast retrieval, say 50, and rescores each with a more accurate but slower model that reads the query and passage together. You then send only the best few to the LLM, improving relevance.

    IntermediateQuick answer1 min read