EasyDeepLearn

All 214 LLMs & GenAI interview questions

Large language models: pretraining, fine-tuning, RAG, hallucinations, and evaluation.

Every question below opens on its own page, with a full answer, the formulas written out and a multiple-choice check. Free to read, no account needed.

Fundamentals

  1. What is a large language model, in one paragraph?easy
  2. Walk through how one training step of an autoregressive LLM works.easy
  3. How does Byte-Pair Encoding (BPE) tokenization work?medium
  4. Why don't LLMs simply use character-level tokenization?medium
  5. What does 'emergence' mean in LLM capabilities and is it real?hard
  6. Why do modern LLMs use decoder-only architectures?medium
  7. What is SwiGLU and why do LLMs use it in the MLP block?hard
  8. What is in-context learning (ICL) and how does it work?medium

Tokenization & embeddings

  1. What are text embeddings and how are they used?easy
  2. How does SentencePiece differ from BPE?medium
  3. Name three practical failure modes caused by tokenization.medium
  4. How does vocabulary construction affect multilingual quality?medium
  5. How do you pick an embedding model for a new RAG project?medium
  6. What's the trade-off between embedding dimension and retrieval quality?medium
  7. What is Matryoshka Representation Learning (MRL)?hard
  8. How is ColBERT different from a standard bi-encoder?hard
  9. What are 'contextual embeddings' and why are they useful?hard
  10. How does multimodal retrieval (image + text) work?hard
  11. When and how do you fine-tune an embedding model?hard
  12. What are 'hard negatives' in embedding training?hard
  13. How does CLIP enable multimodal capability?medium
  14. What breaks when you change the embedding model in a live RAG system?hard

Pretraining & scaling

  1. What data goes into modern LLM pretraining?medium
  2. Why is data deduplication critical for LLM pretraining?medium
  3. Summarize Kaplan et al. (2020) scaling laws in one sentence.hard
  4. State the Chinchilla scaling insight and its practical impact.hard
  5. How do you prevent MoE routing collapse?hard
  6. How do you train an LLM to a long context length?hard
  7. Is data curriculum used in LLM pretraining?hard
  8. How much does it cost to pretrain a modern LLM?hard
  9. Why is the softmax + cross-entropy at the LM head a training bottleneck?hard
  10. What is continual pretraining and when does it beat fine-tuning?hard
  11. What parallelism strategies are combined to train a 70B model?hard
  12. What is embedding tying and when do LLMs use it?medium
  13. What's the practical minimum tokens-per-parameter for a competitive LLM?hard
  14. Can you repeat data across epochs in LLM pretraining?hard
  15. What is benchmark contamination and how do you detect it?hard
  16. How is high-quality instruction-tuning data constructed?medium

Architecture & attention variants

  1. What is the context window and what tricks extend it?medium
  2. What is a Mixture-of-Experts (MoE) LLM?hard
  3. Why did RoPE replace learned positional embeddings in modern LLMs?hard
  4. What is Grouped-Query Attention (GQA) and why does it matter?hard
  5. How does Mixtral 8x7B differ from a dense LLM?hard
  6. How does YaRN extend an LLM's context beyond training length?hard
  7. How does Flash Attention 2 speed up training?hard
  8. How is a modern vision-language model (LLaVA, GPT-4V, Claude 3) built?hard

Fine-tuning & adaptation

  1. Fine-tuning vs RAG — which do you use when?medium
  2. What is LoRA and why is it popular for fine-tuning LLMs?hard
  3. What is supervised fine-tuning (SFT) and where does it fit in the alignment pipeline?easy
  4. How are 'reasoning models' like o1 / R1 trained?hard
  5. Should you fine-tune the LLM for RAG or improve retrieval first?medium
  6. How do you serve many LoRA adapters efficiently?hard
  7. A stakeholder wants the model to 'know our internal docs'. Do you fine-tune or build RAG?medium

Alignment: SFT, RLHF, DPO

  1. Describe the full RLHF pipeline in three stages.hard
  2. Why does the reward model use a Bradley-Terry / log-sigmoid loss?hard
  3. How is PPO adapted for RLHF and what are the main pitfalls?hard
  4. How does DPO simplify RLHF?hard
  5. When does RLHF beat DPO and vice versa?hard
  6. What is KTO and when is it useful?hard
  7. What is ORPO?hard
  8. What is RLAIF and where is it useful?hard
  9. What is Constitutional AI?hard
  10. Give an example of reward hacking in RLHF.medium
  11. What is sycophancy in LLMs and how do you reduce it?medium
  12. How is 'refusal' behavior trained into LLMs?medium
  13. What is the 'alignment tax' and how do you minimize it?medium
  14. What is 'honesty' as an alignment target and how do you train for it?medium
  15. How do you balance helpfulness vs harmlessness in RLHF?hard
  16. Why is PPO used in RLHF instead of vanilla REINFORCE?hard
  17. What is GRPO?hard
  18. What is iterative DPO / online DPO?hard
  19. What is an instruction hierarchy in modern LLMs?hard
  20. How well-calibrated are LLM confidences and how do you fix them?hard

Prompting techniques

  1. What are the pillars of good prompt engineering?easy
  2. Few-shot vs zero-shot — when do you use each?easy
  3. What is chain-of-thought (CoT) prompting?medium
  4. How does self-consistency improve CoT?medium
  5. What is Tree of Thoughts (ToT) and when does it help?hard
  6. Does role-play prompting ('You are a senior lawyer...') actually help?easy
  7. How is the system prompt different from the user prompt?easy
  8. How do you force structured output (JSON) from an LLM?medium
  9. How does function calling / tool use work in modern LLMs?medium
  10. Does position in the context matter for what the LLM 'sees'?medium
  11. Do 'negative prompts' ('do not X') work in LLMs?easy
  12. What is prompt chaining and why prefer it over one big prompt?medium
  13. How do you use one prompt to extract multiple fields at once vs many separate prompts?medium
  14. What is Chain-of-Density (CoD) prompting?hard
  15. How do you get reliable table output from an LLM?medium
  16. When does chain-of-thought HURT performance?hard
  17. How should you write tool descriptions for reliable agent tool selection?medium
  18. Do agents plan explicitly or should we let them just react?hard

Decoding & sampling

  1. What do temperature and top-p do at generation time?easy
  2. How does JSON mode actually work?hard
  3. Greedy decoding vs sampling — when do you pick each?easy
  4. How does top-k differ from top-p sampling?easy
  5. What is min-p sampling?hard
  6. What is repetition penalty and its trade-off?medium
  7. What are stop sequences and why do they matter in production?easy
  8. What is logit bias and when do you use it?medium
  9. How should max_tokens be set in production?easy
  10. Why is streaming output important in production LLM apps?easy
  11. What is speculative decoding?hard
  12. Why don't chat LLMs use beam search?medium
  13. Structured Outputs (OpenAI) / Constrained decoding — how do they differ from JSON mode?hard
  14. How do Medusa and EAGLE differ from vanilla speculative decoding?hard
  15. How do you make an LLM reliably return valid JSON?medium
  16. Does temperature 0 make an LLM deterministic?hard

Retrieval-augmented generation

  1. How does Retrieval-Augmented Generation (RAG) work?medium
  2. How should you chunk documents for RAG?medium
  3. What is indirect prompt injection?hard
  4. Walk through the components of a production RAG pipeline.medium
  5. What chunking strategies exist beyond fixed-size?hard
  6. How do vector databases differ from traditional databases?medium
  7. How does HNSW work in one paragraph?hard
  8. What is IVF-PQ and when do you use it?hard
  9. Why combine dense (vector) and sparse (BM25) retrieval?medium
  10. How does Reciprocal Rank Fusion (RRF) work?medium
  11. What is a cross-encoder reranker and when do you need one?medium
  12. Why rewrite the user's query before retrieval?medium
  13. What is HyDE and how does it help retrieval?hard
  14. How do metadata filters interact with vector search?hard
  15. How do you evaluate a RAG pipeline end-to-end?hard
  16. What is faithfulness in RAG and how do you measure it?medium
  17. What is Graph RAG and when does it beat plain RAG?hard
  18. What is parent-document (small-to-big) retrieval?medium
  19. How do you make an LLM cite its sources reliably?medium
  20. What is 'agentic RAG' or self-RAG?hard
  21. What can you cache in a RAG pipeline?medium
  22. How do you counter 'lost in the middle' in RAG?medium
  23. What are RAG-specific safety concerns?hard
  24. How do you handle the freshness problem in RAG (docs change constantly)?medium
  25. How do you scale to hundreds of tools without overwhelming the LLM?hard
  26. How do you choose a chunking strategy for RAG?medium
  27. Your RAG system gives a wrong answer. How do you find out which stage failed?hard
  28. Why does stuffing more context into a long-context model sometimes make answers worse?hard
  29. Why does hybrid search usually beat pure vector search?medium

Inference: caching, batching, serving

  1. What is quantization and what tradeoffs come with it?medium
  2. What is the KV cache and why does it matter for LLM inference?hard
  3. What is prompt caching and when does it help?hard
  4. What's the difference between prefill and decode in LLM inference?medium
  5. What is continuous / dynamic batching in LLM serving?hard
  6. How does Paged Attention work?hard
  7. What is chunked prefill and why is it useful?hard
  8. How do you trade off throughput vs latency in LLM serving?medium
  9. How does INT8 weight quantization work in practice?medium
  10. Compare GPTQ, AWQ, and NF4 quantization.hard
  11. What is FP8 inference and where does it help?hard
  12. How do you quantize the KV cache and why?hard
  13. When do you distill an LLM for serving?medium
  14. vLLM vs TensorRT-LLM vs TGI vs SGLang — how do you pick?medium
  15. What does 'automatic prefix caching' do in vLLM?hard
  16. What role does NVIDIA Triton play in LLM serving?medium
  17. How do you pick a GPU for serving a 70B LLM?hard
  18. What are typical tokens/sec numbers for popular LLMs on H100?medium
  19. How do you autoscale LLM serving?hard
  20. What SLIs / SLOs are typical for LLM serving?medium
  21. Why is cold-starting an LLM slow and how do you fix it?hard
  22. What LLM observability tools do you deploy?medium
  23. How do you canary-deploy a new LLM version?medium
  24. What is a 'model router' and when is it worth it?hard
  25. Your LLM feature costs too much per request. What levers do you pull, in order?medium
  26. How do you make an LLM feature feel fast when generation is inherently slow?medium

Long context

  1. What is 'needle in a haystack' evaluation?medium

Evaluation & benchmarks

  1. How do you evaluate an LLM system?medium
  2. What is red-teaming in LLM safety?medium
  3. What does MMLU actually measure and its limitations?medium
  4. GSM8K vs MATH vs AIME — what do they measure?medium
  5. HumanEval / MBPP / SWE-bench — how do they test code?medium
  6. What is Chatbot Arena and why is it important?easy
  7. What is Arena-Hard-Auto?medium
  8. What is MT-Bench and how does it differ from Chatbot Arena?medium
  9. How reliable is LLM-as-a-judge and how do you validate it?hard
  10. What is LiveBench and why does it exist?medium
  11. What is EleutherAI's lm-evaluation-harness?medium
  12. How do you evaluate an agent (tool-using LLM)?hard
  13. How do you detect hallucinations in production?hard
  14. What does TruthfulQA measure?medium
  15. How do you test an LLM for social bias?medium
  16. How do you evaluate LLM apps cheaply at scale?medium
  17. How do you build a good golden eval set?medium
  18. How do you measure jailbreak robustness?hard
  19. How do you evaluate an agent's tool-use accuracy?medium
  20. How do you evaluate multimodal LLMs?medium
  21. What biases affect LLM-as-a-judge evaluation, and how do you control them?hard
  22. You have no evaluation set for a new LLM feature. How do you build one quickly?medium

Hallucinations & reliability

  1. Why do LLMs hallucinate and how do you reduce hallucinations?medium
  2. Name three types of LLM hallucination.medium
  3. Can LLMs leak their training data?hard
  4. What copyright / IP issues arise with LLMs in production?hard
  5. What are the main failure modes of LLM agents?hard

Safety, guardrails, red-teaming

  1. What are the main LLM safety and alignment concerns?medium
  2. Name three types of LLM jailbreak.medium
  3. How do content moderation filters complement alignment?medium
  4. How do you protect an LLM API from abuse / cost spikes?medium
  5. What defenses actually work against jailbreaks?hard
  6. What does Llama Guard do?medium
  7. How do you handle PII in an LLM pipeline?medium
  8. What security concerns are specific to agents with tool use?hard
  9. How do you defend a RAG or agent system against prompt injection?hard

Agents & tool use

  1. Describe a basic ReAct / agent loop.medium
  2. How is 'memory' typically implemented in agents?medium
  3. When do multi-agent systems beat single-agent?hard
  4. How does a coding agent (SWE-agent, Aider, Cursor) actually work?hard
  5. What's hard about web-navigation agents?hard
  6. What does an ideal function-calling schema look like?medium
  7. How do parallel tool calls work?medium
  8. What is the Model Context Protocol (MCP)?medium
  9. How do you keep agent costs bounded?medium
  10. When should you not build an agent?medium

Multimodal LLMs

  1. How do multimodal LLMs handle OCR / document understanding?medium
  2. Why are multimodal LLMs so expensive to run?medium
  3. How do audio LLMs like Whisper / Voxtral / GPT-4o-audio work?hard

Production concerns

  1. How do you estimate LLM API cost for a workload?medium

Other topics