
LLM interview questions check whether you understand how large language models work under the hood, not whether you can recite a model’s marketing page. This guide explains 13 common questions in plain English, with what a strong answer covers and the mistakes that weaken one.
It is for software engineers, data scientists, ML engineers and AI application developers preparing for a role that builds on LLMs. It is part 2 of our weekly interview prep series.
Key takeaways
- Know the core mechanism: an LLM predicts the next token, one token at a time, using a transformer.
- Tokens are not words: tokenization, context windows and output limits are all counted in tokens.
- Know the training stages: pretraining, supervised fine-tuning and preference tuning, plus cheaper options such as LoRA.
- Talk about reliability: sampling settings, hallucinations and grounding.
What LLM interviews usually cover
Most LLM interviews mix concept questions (explain attention or tokenization), applied questions (fit a long document into a model, reduce wrong answers) and trade-off questions (fine-tune or prompt, and what a longer context costs).
Tip: A short, correct explanation with one example beats a list of model names. If a question goes beyond your experience, say so and reason it through.
LLM fundamentals: transformers and attention
1. What is a large language model, and how does it generate text?
In plain English: An LLM is a neural network trained on large amounts of text to predict the next token. To generate an answer, it predicts one token, adds it to the input, and repeats. The GPT-3 paper (Brown et al., 2020) showed a 175-billion-parameter model doing many tasks from a few examples in the prompt (few-shot or in-context learning).
A strong answer covers: next-token prediction, the generation loop, the difference between training and inference, and in-context learning.
Common mistakes: saying the model looks answers up in a database.
2. Explain the transformer architecture at a high level.
In plain English: The transformer, introduced in “Attention Is All You Need” (Vaswani et al., 2017), replaced recurrence with attention. Each layer has self-attention and a feed-forward block, with residual connections and layer normalization. The original decoder masked future positions so each prediction depends only on earlier tokens.
A strong answer covers: stacked attention and feed-forward layers, and why dropping recurrence made training more parallel.
Common mistakes: describing the transformer as an RNN with attention added, or skipping the decoder mask.
3. How does self-attention work, and what does it cost?
In plain English: For each token, the model builds a query, a key and a value. It compares the query with every key, scales the scores by the square root of the key size, applies a softmax and takes a weighted mix of the values: softmax(QKT/√dk)V. Multi-head attention runs several of these in parallel.
A strong answer covers: the Q, K and V roles, why scaling helps (large dot products push the softmax toward tiny gradients), and the cost: O(n²·d) per layer for sequence length n.
Common mistakes: forgetting the softmax or the scaling, or claiming attention cost grows linearly with length.
4. Why does a transformer need positional information?
In plain English: Attention on its own does not know word order. The original transformer added sinusoidal positional encodings to the token embeddings (learned ones gave nearly identical results). Many newer models use rotary position embedding (RoPE), which encodes position with a rotation and brings relative position into attention (Su et al., 2021).
A strong answer covers: why order is lost, absolute versus relative position, and one named method you can describe accurately.
Common mistakes: saying the model “just reads left to right”, or naming RoPE without being able to say what it does.
Tokens, context windows and embeddings
5. What is a token, and how does tokenization work?
In plain English: A token is a unit of text: a word, part of a word, a character or punctuation. Byte pair encoding starts from characters and repeatedly merges the most frequent adjacent pair (Sennrich et al., 2015; Hugging Face documentation). OpenAI’s help article gives a rough English rule of thumb: one token is about four characters, or about three-quarters of a word.
A strong answer covers: why subwords handle rare and new words, and that counts vary by model and language.
Common mistakes: treating tokens as words, or quoting the four-character rule as exact for every language.
6. What is a context window, and what happens when you exceed it?
In plain English: The context window is the maximum number of tokens a model can work with in a request. OpenAI’s documentation notes that models also have a separate output limit, and that reasoning models need room for reasoning tokens. Too-long input must be shortened, split, summarized or retrieved selectively.
A strong answer covers: input versus output limits, and the “Lost in the Middle” finding (Liu et al., 2023): models often used information best when it was at the start or end of a long input.
Common mistakes: assuming a bigger window means the model uses every part of it equally well.
7. Encoder-only, decoder-only and encoder-decoder: what is the difference?
In plain English: Encoder-only models such as BERT read the whole input in both directions and are trained by predicting masked words, which suits classification and search. Decoder-only models such as GPT read left to right and generate text. Encoder-decoder models, like the original transformer, suit translation and summarization.
A strong answer covers: the training objective and typical tasks of each type.
Common mistakes: saying BERT generates text like a chat model.
8. What are embeddings, and what are they used for?
In plain English: An embedding is a list of numbers that represents a piece of text. OpenAI’s embeddings guide explains that the distance between two vectors measures how related the texts are, and lists uses such as search, clustering, recommendations, anomaly detection and classification.
A strong answer covers: similarity measures such as cosine similarity, and storing vectors for search.
Common mistakes: confusing embeddings with tokens, or assuming vectors from two different embedding models can be compared.
Interviewing for AI or ML roles?
Submit your profile with your stack, projects and preferred work setup. There is never a fee for candidates.
Submit your profileSearch current jobs →Training, fine-tuning and generation
9. What do temperature and top-p control?
In plain English: Both change how the next token is sampled. In OpenAI’s API reference, temperature ranges from 0 to 2: higher values make output more random and lower values make it more focused. Top-p, or nucleus sampling, samples only from the smallest set of tokens that makes up the chosen share of probability. OpenAI recommends changing one, not both. Nucleus sampling comes from Holtzman et al. (2019), who truncated the unreliable tail of the distribution.
A strong answer covers: what each setting does to the distribution, when you would lower it (extraction, code) or raise it (brainstorming).
Common mistakes: claiming temperature 0 always gives identical output, or tuning both at once.
10. How does a base model become a helpful assistant?
In plain English: Pretraining teaches next-token prediction on large text collections. The InstructGPT paper (Ouyang et al., 2022) then fine-tuned on human-written demonstrations, trained a reward model from human rankings of outputs, and optimized the model against it with reinforcement learning. Labelers preferred outputs from the 1.3-billion-parameter InstructGPT model over the 175-billion-parameter GPT-3 in that study.
A strong answer covers: the three stages, and why predicting the next token is not the same as following instructions.
Common mistakes: saying RLHF teaches the model new facts, or treating fine-tuning and prompting as the same thing.
11. What is LoRA, and why use it instead of full fine-tuning?
In plain English: LoRA (low-rank adaptation) freezes the pretrained weights and trains small low-rank matrices added to layers of the transformer. Hu et al. (2021) report that, compared with fully fine-tuning GPT-3 175B with Adam, LoRA cut trainable parameters by 10,000 times and GPU memory by 3 times, with no extra inference latency.
A strong answer covers: frozen weights, rank as a knob, small swappable adapters, and when prompting or retrieval is cheaper.
Common mistakes: describing LoRA as compression of the whole model, or fine-tuning when the real problem is missing or stale facts.
12. What is the KV cache, and why does it speed up generation?
In plain English: When a model generates one token at a time, it would otherwise recompute the keys and values for every earlier token at each step. The Hugging Face Transformers documentation describes the KV cache as storing those calculations so they can be reused. It saves compute, but the cache uses memory that grows as the sequence gets longer.
A strong answer covers: the speed versus memory trade-off, and why long contexts make memory the bottleneck.
Common mistakes: saying the KV cache stores previous answers between users, or that it changes the model’s output.
13. What causes hallucinations, and how do you reduce them?
In plain English: OpenAI describes hallucinations as plausible but false statements, and argues (September 2025) that standard training and evaluation reward guessing over admitting uncertainty. Fixes include grounding answers in retrieved documents (retrieval-augmented generation, Lewis et al., 2020), allowing “I don’t know”, lowering randomness and evaluating on your own data.
A strong answer covers: grounding, abstention, and how you would measure the error rate before and after a change.
Common mistakes: promising that a bigger model or a lower temperature removes hallucinations, or skipping evaluation entirely.
How Entrustech sees LLM interviews
Entrustech is a staffing and recruiting firm in East Brunswick, New Jersey, working with technical candidates and with teams hiring for software, data and AI roles. In our conversations with hiring teams, candidates who stand out explain one mechanism clearly and tie it to a real decision, such as adding a retrieval step.
For a full preparation plan, start with how to prepare for a technical interview. If your loop includes a design round, practise with our system design interview questions, since many AI features are built on queues, caches and APIs. Our candidate resources cover the rest of the process.
Frequently asked questions
Do I need to know the math behind attention for an LLM interview?
For most applied roles, explain the formula in words: queries are compared with keys, scores are scaled and softmaxed, and values are mixed. Research roles go deeper.
How many tokens is a page of text?
It depends on the tokenizer and language. OpenAI’s rough English estimate is 100 tokens for about 75 words; use the model’s own tokenizer when it matters.
Is fine-tuning or retrieval the better answer to most applied questions?
Neither is always right. Retrieval suits facts that change or must be cited; fine-tuning suits a consistent format or narrow task. Explain the trade-off and how you would test it.
How should I practise LLM interview questions?
Answer each question out loud in under two minutes, check it against the sources cited here, and build one small project, such as a document Q&A tool, so you can discuss real trade-offs.
Ready for interviews that fit your skills?
Share your profile, stack and location. A recruiter reviews every profile.
Submit your profileSources (accessed November 30, 2026)
- Brown et al., “Language Models are Few-Shot Learners,” arXiv (May 28, 2020). Accessed Nov 30, 2026.
- Vaswani et al., “Attention Is All You Need,” arXiv (June 12, 2017). Accessed Nov 30, 2026.
- Su et al., “RoFormer: Enhanced Transformer with Rotary Position Embedding,” arXiv (April 20, 2021). Accessed Nov 30, 2026.
- Sennrich, Haddow and Birch, “Neural Machine Translation of Rare Words with Subword Units,” arXiv (August 31, 2015). Accessed Nov 30, 2026.
- Hugging Face Transformers documentation, “Tokenization algorithms”. Accessed Nov 30, 2026.
- OpenAI Help Center, “Understanding and counting tokens”. Accessed Nov 30, 2026.
- Liu et al., “Lost in the Middle: How Language Models Use Long Contexts,” arXiv (July 6, 2023). Accessed Nov 30, 2026.
- Devlin et al., “BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding,” arXiv (October 11, 2018). Accessed Nov 30, 2026.
- OpenAI API documentation, “Vector embeddings”. Accessed Nov 30, 2026.
- OpenAI API reference, “Create chat completion” (temperature, top_p). Accessed Nov 30, 2026.
- Holtzman et al., “The Curious Case of Neural Text Degeneration,” arXiv (April 22, 2019). Accessed Nov 30, 2026.
- Ouyang et al., “Training language models to follow instructions with human feedback,” arXiv (March 4, 2022). Accessed Nov 30, 2026.
- Hu et al., “LoRA: Low-Rank Adaptation of Large Language Models,” arXiv (June 17, 2021). Accessed Nov 30, 2026.
- Hugging Face Transformers documentation, “Cache strategies”. Accessed Nov 30, 2026.
- OpenAI, “Why language models hallucinate” (September 5, 2025). Accessed Nov 30, 2026.
- Lewis et al., “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks,” arXiv (May 22, 2020). Accessed Nov 30, 2026.
Written and reviewed by the Entrustech Recruiting team. Entrustech Recruiting is a service of Entrustech Inc., a staffing and recruiting company in East Brunswick, New Jersey. Last updated December 2, 2026. Questions or corrections: contact@entrustechinc.com.


