LLM & Transformer Interview Questions
120 questions on attention mechanisms, GPT, BERT, fine-tuning, RLHF, prompt engineering. The first 20 are free, no account needed.
Practice free βWhat this topic covers
Large language models now appear in almost every ML interview, from startups building products on top of hosted models to labs training their own. This topic covers the transformer from the inside out, then the techniques used to adapt, ground and serve these models.
The architecture questions begin with self-attention: queries, keys and values, why the dot product is scaled, what multiple heads add, and how positional information is injected. You should be able to walk through an encoder block and a decoder block, explain causal masking, and describe the differences between encoder-only, decoder-only and encoder-decoder models. Tokenization questions cover byte pair encoding and why vocabulary choices affect cost and quality.
Pre-training and fine-tuning questions compare masked and autoregressive objectives, then move to adaptation: full fine-tuning, parameter-efficient methods such as LoRA and adapters, instruction tuning, and alignment methods including reinforcement learning from human feedback. Prompting questions ask about few-shot examples, chain-of-thought, structured output and how to defend against prompt injection.
Retrieval-augmented generation and agents form a large part of the bank. Expect questions on chunking, embeddings, vector search, reranking, grounding and citation, and on tool use, planning and the failure modes of multi-step agents. Inference questions cover sampling parameters, context windows, KV caching, quantization and batching, since latency and cost decide whether an LLM feature can ship.
What interviewers look for
Because the field moves quickly, interviewers care less about naming the newest model and more about first principles. If you can explain why attention is quadratic in sequence length, you can reason about any long-context technique. If you understand what a KV cache stores, you can explain why the first token is slow and later tokens are fast.
Evaluation is the area where candidates most often fall short. Be prepared to describe how you would measure hallucination, build a regression set for a prompt change, and combine automatic metrics with human review. For RAG systems, separate retrieval quality from generation quality and say how you would measure each.
The sample questions below are free and include full explanations. They mix conceptual questions with applied ones about building and operating LLM features, which mirrors how these interviews are usually run.
Sample LLM interview questions
- Explain the self-attention mechanism in detail. What are Q, K, V and why do we use scaled dot-product attention?π‘ intermediate Β· Transformer Architecture
- Explain positional encoding in Transformers. Compare sinusoidal, learned, RoPE, and ALiBi.π΄ advanced Β· Transformer Architecture
- Explain the difference between LoRA, full fine-tuning, and prompt tuning. When would you use each?π‘ intermediate Β· Pre-training & Fine-tuning
- Explain RLHF (Reinforcement Learning from Human Feedback). What are the key steps and challenges?π΄ advanced Β· RLHF & Alignment
- What is chain-of-thought prompting? Why does it improve reasoning?π’ beginner Β· Prompt Engineering
- Explain RAG (Retrieval-Augmented Generation). What are the key components and failure modes?π‘ intermediate Β· RAG & Agents
- Explain FlashAttention. How does it achieve sub-quadratic memory while maintaining exact attention?β« expert Β· Transformer Architecture
- How do you evaluate LLMs? What benchmarks and metrics matter?π΄ advanced Β· Pre-training & Fine-tuning
- What is the difference between encoder-only, decoder-only, and encoder-decoder transformers?π‘ intermediate Β· Pre-training & Fine-tuning
- Design an AI agent system with tool use. What are the key components and challenges?π΄ advanced Β· RAG & Agents
- What is DPO (Direct Preference Optimization)? How does it compare to RLHF?π‘ intermediate Β· RLHF & Alignment
- What are Large Language Models (LLMs) and how do they work?π’ beginner Β· Transformer Architecture
- How does multi-head attention differ from single-head attention? Why use multiple heads?π‘ intermediate Β· Transformer Architecture
- Explain the tokenization strategies used in LLMs: BPE, WordPiece, and SentencePiece.π΄ advanced Β· Pre-training & Fine-tuning
- What is the scaling laws relationship between model size, data, and compute?π΄ advanced Β· Pre-training & Fine-tuning