LLM Fundamentals interview questions and answers

10 questions from the LLM Fundamentals Interview Mock practice bank, spread across its domains. Pick your answer, then open the explanation to see why each option is right or wrong.

  1. Question 1How Models Work

    A byte-level BPE tokenizer, like GPT-2's, can encode any input string without ever producing an unknown token.

    • A

      True

    • B

      False

    Show the answer and explanation

    Answer: A

    Character-level BPE with a limited base alphabet maps unseen characters to [UNK]; in the Hugging Face course example, mug becomes [UNK], ug because m was never seen. Byte-level BPE avoids this entirely. The catch is cost: rare scripts may be split into many byte tokens.

    Why the other options are wrong

    • B. Character-level BPE can hit unknown characters, but byte-level BPE always has a byte to fall back on.

  2. Question 2Using Models Well

    A user asks your assistant, which has no tools, "Who is the current CEO of a large listed company?" The model's training data ended a year ago. What is the best design?

    • A

      Let the model answer from memory and add "I am always up to date" to the prompt

    • B

      Refuse all questions about people

    • C

      Fine-tune the model every morning on the latest news so that its weights always hold the newest facts

    • D

      Retrieve current information, pass today's date, and state the cutoff when nothing is found

    Show the answer and explanation

    Answer: D

    Questions with words like "current", "latest" or "today" are where cutoff-driven hallucination appears. Give the model fresh evidence and the current date; when no evidence is available, have it say what it knew as of its cutoff rather than presenting stale facts as current.

    Why the other options are wrong

    • A. Claiming freshness in the prompt does not update the weights; it only makes stale answers sound authoritative.

    • B. That throws away many legitimate questions to avoid one kind of staleness.

    • C. Daily fine-tuning is costly, slow and unreliable for injecting specific facts. Retrieval suits facts that change.

  3. Question 3Evaluation and Model Choice

    A router sends most traffic to a cheap model. Overall user satisfaction drops slightly, but the cheap model's answers look confident and well formatted. Which two safeguards best catch silent routing errors? (Choose two.)

    Choose 2.

    • A

      Regularly sample routed-to-cheap traffic and grade it against the strong model or human review

    • B

      Track quality metrics per route and per query category, not only overall

    • C

      Judge the cheap model by how confident its wording sounds

    • D

      Route more traffic to the cheap model to collect more data

    • E

      Remove the router and send everything to the cheap model

    Show the answer and explanation

    Answer: A and B

    Routing errors are silent because a cheap model rarely says it is out of its depth. Measure routed traffic directly, segment metrics by route and category, and recalibrate the routing threshold against a cost-quality target.

    Why the other options are wrong

    • C. Fluent, confident wording is exactly what hides the errors.

    • D. That makes the hidden quality problem larger.

    • E. That removes the protection for hard queries entirely.

  4. Question 4Production and Safety

    A support bot sends customer chats to a third-party LLM API. Compliance requires that card numbers and Aadhaar numbers never leave your systems. Which control actually meets this requirement?

    • A

      Instruct the model in the system prompt never to repeat personal numbers in its replies

    • B

      Run a PII detector over every model reply before it is shown to the human support agent

    • C

      Detect and redact or tokenise these identifiers in your own service before the API call

    • D

      Turn on the provider's zero-retention setting and keep sending the full chats

    Show the answer and explanation

    Answer: C

    Prevent first, then detect: redact or pseudonymise sensitive fields before inference (and restore them afterwards if the workflow needs it), minimise what is sent, scan outputs as a second layer, and set retention and logging policies. OWASP LLM02:2025 lists sanitisation, tokenisation and redaction, and strict access controls among its mitigations.

    Why the other options are wrong

    • A. By then the numbers have already been sent to the provider. The instruction only affects what comes back.

    • B. Output scanning is useful, but it runs after the data has already left your systems.

    • D. Retention settings limit what the provider stores, but the data still leaves your systems, which breaks the requirement.

  5. Question 5How Models Work

    How does a contextual embedding from a transformer differ from a static word vector?

    • A

      It depends on the surrounding tokens, so one word gets different vectors in different sentences

    • B

      It is a larger lookup table with more dimensions per word

    • C

      It is retrained for every new sentence the model sees

    • D

      It ignores word order completely, which is what makes contextual vectors robust to typos and to shuffled sentences

    Show the answer and explanation

    Answer: A

    A static model has one vector per word, so bank (river) and bank (finance) collide. A transformer starts from a static token-embedding lookup but then passes it through attention layers, and the resulting hidden state depends on the whole input. That is why transformer hidden states, suitably pooled, make much better features for downstream tasks than static vectors.

    Why the other options are wrong

    • B. The input embedding layer of a transformer is a lookup table, but the contextual vectors come from the layers that follow it.

    • C. Weights are fixed at inference; only the activations change with the input.

    • D. Transformers use positional information; contextual vectors depend on order.

  6. Question 6Using Models Well

    Which two statements about sycophancy are supported by research on preference-tuned assistants? (Choose two.)

    Choose 2.

    • A

      Humans and preference models sometimes prefer a convincingly written sycophantic answer over a correct one

    • B

      Optimising responses harder against a preference model can trade truthfulness for sycophancy

    • C

      Sycophancy appears only in base models and disappears after RLHF

    • D

      Setting temperature to 0 removes sycophancy

    • E

      Sycophancy only affects opinions, never factual answers

    Show the answer and explanation

    Answer: A and B

    Sharma et al. found sycophancy across five assistants and four tasks. In preference data, responses matching the user's views were more likely to be preferred, and both humans and preference models sometimes chose convincing sycophantic answers over correct ones. This is why evaluations based only on user approval can reward sycophancy.

    Why the other options are wrong

    • C. The research links sycophancy partly to human preference judgments used in RLHF, so tuning can encourage it.

    • D. Sycophancy is a learned preference, so it shows up with greedy decoding too.

    • E. Assistants changed correct factual answers when challenged, and copied users' wrong factual claims.

  7. Question 7Evaluation and Model Choice

    Two teams compare perplexity on the same test text. Model A uses a 32k-token vocabulary and model B a 128k-token vocabulary. Why can't the raw per-token perplexities be compared directly?

    • A

      Perplexity is only defined for vocabularies smaller than 50k

    • B

      Per-token averages depend on how each tokenizer splits the text

    • C

      Larger vocabularies push perplexity towards exactly 1, because each token then carries almost all of the information

    • D

      Perplexity must be computed with a masked language model to be comparable

    Show the answer and explanation

    Answer: B

    Perplexity averages over tokens, and the tokenizer decides what a token is. A model whose tokens are longer predicts fewer, harder units, so its per-token perplexity is not on the same scale. Compare using the same tokenizer, or normalise per character or byte.

    Why the other options are wrong

    • A. There is no such limit; perplexity is defined for any vocabulary size.

    • C. Nothing forces perplexity to 1; it reflects prediction quality and token granularity.

    • D. The reverse: perplexity is not well defined for masked models.

  8. Question 8Production and Safety

    Which two defences keep protecting you even when the model has been successfully prompt-injected? (Choose two.)

    Choose 2.

    • A

      Giving each tool only the minimum permissions it needs, enforced by the backend

    • B

      Telling the model in the system prompt to ignore instructions found in documents

    • C

      Requiring a human to approve irreversible actions such as payments or deletions

    • D

      Wrapping retrieved text in special delimiters before adding it to the prompt

    • E

      Lowering the sampling temperature to make the model's behaviour more predictable

    Show the answer and explanation

    Answer: A and C

    Split defences into two groups. Some lower the probability of injection: prompt wording, delimiters or spotlighting, classifiers, instruction-hierarchy training. Others limit the impact when injection happens: least privilege, human approval, sandboxing, output validation, egress limits. Interviewers want to hear that the second group is what makes an agent safe to ship.

    Why the other options are wrong

    • B. If the injection succeeded, the model already ignored this kind of instruction.

    • D. Delimiters can lower success rates, but an injected model is by definition no longer respecting them.

    • E. Temperature affects randomness, not whose instructions the model follows.

  9. Question 9How Models Work

    Which statements about rotary position embedding (RoPE) are correct? (Choose two.)

    Choose 2.

    • A

      It rotates query and key vectors by angles that depend on their positions

    • B

      After rotation, the query-key dot product depends on positions only through their offset m - n

    • C

      It adds a learned position vector to the token embedding once, before the first layer

    • D

      It rotates the value vectors as well, so outputs carry position

    • E

      It needs a separate learned parameter for every position up to the maximum context

    Show the answer and explanation

    Answer: A and B

    RoPE splits each query and key into 2-D pairs and rotates pair i by an angle proportional to position times a fixed frequency. Because rotations compose, the score between positions m and n depends on m - n. It encodes absolute position yet behaves relatively, adds no learned parameters, and the paper shows a decay of dependency with distance. Most open decoder models use it.

    Why the other options are wrong

    • C. That is learned absolute position embedding. RoPE is applied multiplicatively inside attention.

    • D. The RoFormer formulation applies the rotation to queries and keys only.

    • E. RoPE angles come from fixed frequencies theta_i = 10000^(-2(i-1)/d); there is no per-position table to learn.

  10. Question 10Using Models Well

    Research on why language models hallucinate argues that common evaluations reward guessing. What is the mechanism?

    • A

      Benchmarks give no credit for long answers, so models learn to be brief and vague

    • B

      Benchmarks are mostly multiple choice, and models cannot handle open questions

    • C

      Benchmarks are contaminated, so models memorise answers instead of learning

    • D

      Binary grading scores "I don't know" the same as a wrong answer

    Show the answer and explanation

    Answer: D

    Kalai et al. argue that hallucinations arise naturally from pretraining statistics and persist because most leaderboards use binary grading. A model optimised to score well learns to guess. Their proposed fix is to change the scoring of mainstream benchmarks, for example by stating a confidence target and penalising wrong answers, so that honest abstention is rewarded.

    Why the other options are wrong

    • A. The argument concerns how abstaining is scored, not answer length.

    • B. The format is not the issue; the scoring of uncertain answers is.

    • C. Contamination is a real problem, but this argument is about the incentives of binary grading.

Practise all 450 LLM Fundamentals questions

Start with the free 15-question diagnostic. It shows where to focus, and your results carry over if you sign up.

Go to LLM Fundamentals