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 measure the quality of retrieval in a RAG system?

    Use a set of questions with known correct passages and compute recall at k, the share of questions where a correct chunk appears in the top k, and MRR, which rewards ranking the correct chunk higher. Check retrieval separately from the generated answer.

    IntermediateQuick answer1 min read
  3. 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
  4. 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