50 AI Agents & LLMs interview questions and answers

AI agent and LLM interview questions on transformers, tokens, prompting, RAG, embeddings, tool calling, MCP, agent loops, memory, multi-agent systems, evals and safety, each with sources.

New to AI engineering?Follow the learning path: a 10-minute setup, then five stages in order, each ending with a small project.Start here →

Easy8 easy AI Agents & LLMs questions

  1. 1What is a large language model (LLM)?
  2. 2What are tokens, and why do they matter?
  3. 4What is a context window?
  4. 7What are hallucinations, and how do you reduce them?
  5. 11What is prompt engineering, and which techniques matter most?
  6. 12What is the difference between zero-shot and few-shot prompting?
  7. 21What is Retrieval-Augmented Generation (RAG)?
  8. 31What is an AI agent, and how is it different from a workflow?

Medium31 medium AI Agents & LLMs questions

  1. 3How does self-attention in a transformer work?
  2. 5What do temperature, top-p and top-k control?
  3. 6How are LLMs trained? Explain pre-training, fine-tuning and RLHF.
  4. 8What are embeddings, and how is similarity measured?
  5. 9What is the KV cache, and why does it speed up inference?
  6. 13What is chain-of-thought prompting?
  7. 14What is self-consistency in LLM reasoning?
  8. 15What is a system prompt, and how do message roles work?
  9. 16How do you get reliable structured (JSON) output from an LLM?
  10. 18What is prompt caching, and how do you use it well?
  11. 19What are reasoning models and "extended thinking"?
  12. 20Why stream LLM responses, and how do you do it?
  13. 22How do you chunk documents for RAG?
  14. 23What is a vector database, and how does approximate nearest-neighbour search work?
  15. 24What are hybrid search and reranking, and why do they improve RAG?
  16. 26What is the "lost in the middle" problem?
  17. 28How do you make an LLM cite its sources reliably?
  18. 29What is LoRA and parameter-efficient fine-tuning (PEFT)?
  19. 32How does tool use (function calling) work?
  20. 33What is the ReAct pattern?
  21. 34How do you implement an agent loop?
  22. 35How does memory work in AI agents?
  23. 36What is the Model Context Protocol (MCP)?
  24. 38What planning strategies do agents use?
  25. 39What is reflection or self-critique in agents?
  26. 41How do you evaluate LLM applications?
  27. 43How do you reduce the cost and latency of an LLM app?
  28. 44How do you handle rate limits, retries and errors with LLM APIs?
  29. 45How do you monitor and debug LLM apps and agents in production?
  30. 48How are AI agents benchmarked?
  31. 49How do you test code that calls an LLM?

Hard11 hard AI Agents & LLMs questions

  1. 10Prompting, RAG or fine-tuning: when do you use each?
  2. 17What is prompt injection, and how do you defend against it?
  3. 25How do you evaluate a RAG system?
  4. 27What are query rewriting and HyDE in retrieval?
  5. 30How does DPO differ from RLHF?
  6. 37How do multi-agent systems work, and when should you use one?
  7. 40What are the common agentic workflow patterns?
  8. 42How do you make AI agents safe in production?
  9. 46What is context engineering, and how do you manage context in long-running agents?
  10. 47How is LLM inference optimised for serving at scale?
  11. 50System design: how would you build an AI customer-support agent?