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 are hallucinations in LLMs, and how can you reduce them?

    A hallucination is when an LLM produces fluent, confident output that is false or not supported by its input, such as an invented fact or citation. You reduce them by grounding the model in real sources, allowing it to say "I don't know", lowering randomness and checking outputs.

    BeginnerIn-depth3 min read
  2. What are tokens and the context window in an LLM?

    Tokens are the small pieces of text (whole words, parts of words or symbols) that an LLM reads and writes. The context window is the maximum number of tokens the model can consider at once, including both your input and its output.

    BeginnerIn-depth3 min read
  3. What is a large language model (LLM), and how does it generate text?

    An LLM is a neural network trained on a huge amount of text to predict the next token. It generates text by predicting one token at a time, adding it to the input, and repeating until it stops.

    BeginnerIn-depth3 min read
  4. What is prompt engineering, and what makes a good prompt?

    Prompt engineering is writing and testing the input to an LLM so it reliably produces the output you need. Good prompts give clear instructions and context, show a few examples when the format matters, and ask for a specific output structure.

    BeginnerIn-depth3 min read
  5. What are parameters in a language model, and does a bigger model always perform better?

    Parameters are the learned numbers, mostly weights, that define what the model does. More parameters generally raise capability, but data quality, training method, and task fit matter too, and larger models cost more and respond slower.

    BeginnerQuick answer1 min read
  6. What does it mean that an LLM API is stateless?

    The model keeps no memory between calls. Each request must contain everything it needs, including earlier conversation turns. Chat apps create the feeling of memory by resending the history, which also means the history uses tokens every time.

    BeginnerQuick answer1 min read
  7. 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
  8. What is a knowledge cutoff, and how does it affect an LLM's answers?

    The cutoff is the point after which the training data contains nothing, so the model does not know later events unless they are given in the prompt or fetched by a tool. It may also answer confidently as if the world stopped at that date.

    BeginnerQuick answer1 min read
  9. What is the difference between a base model and an instruction-tuned model?

    A base model is trained only to continue text, so it may ramble or continue your question with more questions. An instruction-tuned model is further trained on examples of instructions and good answers, so it follows requests and replies helpfully.

    BeginnerQuick answer1 min read
  10. What is the difference between an LLM and a chatbot?

    An LLM is the underlying model that turns input text into output text. A chatbot is a full product around it, with a chat interface, instructions, memory handling, safety checks, and often tools or company data.

    BeginnerQuick answer1 min read
  11. What is the difference between training and inference in an LLM?

    Training adjusts the model's weights by learning from data and costs enormous compute once. Inference uses the finished, frozen weights to answer a prompt and happens on every request. A chat message never changes the weights.

    BeginnerQuick answer1 min read
  12. Why can an LLM give different answers to the same question?

    Most chat settings sample the next token from a probability distribution instead of always taking the top one, so small random choices early on lead to different wording or even different conclusions. Lowering temperature reduces this variation.

    BeginnerQuick answer1 min read