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
- 1What is a large language model (LLM)?
- 2What are tokens, and why do they matter?
- 4What is a context window?
- 7What are hallucinations, and how do you reduce them?
- 11What is prompt engineering, and which techniques matter most?
- 12What is the difference between zero-shot and few-shot prompting?
- 21What is Retrieval-Augmented Generation (RAG)?
- 31What is an AI agent, and how is it different from a workflow?
Medium31 medium AI Agents & LLMs questions
- 3How does self-attention in a transformer work?
- 5What do temperature, top-p and top-k control?
- 6How are LLMs trained? Explain pre-training, fine-tuning and RLHF.
- 8What are embeddings, and how is similarity measured?
- 9What is the KV cache, and why does it speed up inference?
- 13What is chain-of-thought prompting?
- 14What is self-consistency in LLM reasoning?
- 15What is a system prompt, and how do message roles work?
- 16How do you get reliable structured (JSON) output from an LLM?
- 18What is prompt caching, and how do you use it well?
- 19What are reasoning models and "extended thinking"?
- 20Why stream LLM responses, and how do you do it?
- 22How do you chunk documents for RAG?
- 23What is a vector database, and how does approximate nearest-neighbour search work?
- 24What are hybrid search and reranking, and why do they improve RAG?
- 26What is the "lost in the middle" problem?
- 28How do you make an LLM cite its sources reliably?
- 29What is LoRA and parameter-efficient fine-tuning (PEFT)?
- 32How does tool use (function calling) work?
- 33What is the ReAct pattern?
- 34How do you implement an agent loop?
- 35How does memory work in AI agents?
- 36What is the Model Context Protocol (MCP)?
- 38What planning strategies do agents use?
- 39What is reflection or self-critique in agents?
- 41How do you evaluate LLM applications?
- 43How do you reduce the cost and latency of an LLM app?
- 44How do you handle rate limits, retries and errors with LLM APIs?
- 45How do you monitor and debug LLM apps and agents in production?
- 48How are AI agents benchmarked?
- 49How do you test code that calls an LLM?
Hard11 hard AI Agents & LLMs questions
- 10Prompting, RAG or fine-tuning: when do you use each?
- 17What is prompt injection, and how do you defend against it?
- 25How do you evaluate a RAG system?
- 27What are query rewriting and HyDE in retrieval?
- 30How does DPO differ from RLHF?
- 37How do multi-agent systems work, and when should you use one?
- 40What are the common agentic workflow patterns?
- 42How do you make AI agents safe in production?
- 46What is context engineering, and how do you manage context in long-running agents?
- 47How is LLM inference optimised for serving at scale?
- 50System design: how would you build an AI customer-support agent?