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 does next-token prediction mean, and why does it produce fluent text?

    The model reads the text so far and outputs a probability for every possible next token, picks one, appends it and repeats. Because it was trained on huge amounts of real text, the likely next token is usually grammatical and on topic.

    BeginnerQuick answer1 min read
  2. What is greedy decoding, and what is its weakness?

    Greedy decoding always picks the single most probable next token. It is deterministic and fast, but it can produce repetitive or dull text and can miss better full sentences, because a locally best word may lead to a worse overall answer.

    BeginnerQuick answer1 min read
  3. What do repetition, frequency and presence penalties do during generation?

    They lower the chance of tokens that have already appeared. A frequency penalty grows with each repeat, a presence penalty applies once a token has appeared at all. They reduce loops and repeated phrases but can hurt text that needs repetition.

    IntermediateQuick answer1 min read