LearnThatStack Ace your next interview
AI Engineering

AI Agents.

Start free Change topic Change

Practise AI Agents one question at a time. Answer out loud or in writing, get graded, and see exactly what you missed.

Try one question

What is an AI agent, and how is it different from a single LLM call?

The answer

An AI agent is an LLM given a goal, a set of tools, and permission to take several steps on its own. A single LLM call is one turn: text in, text out, then it is over.

Single LLM call Agent
Steps Exactly one Keeps going until the goal is met
Who picks the next action Your code The model, at runtime
Tools None, or one round you handle Called repeatedly, results fed back in
State Stateless Carries context across steps
Cost and latency Predictable Varies run to run

The real difference is control. You trade a predictable path for the ability to handle tasks whose steps are unknown up front. That is why every agent needs step limits, spend budgets, and logs.

Example · what grading looks like
What is tool use (function calling), and why is it called the foundation of agents?

“So function calling is how the model gets to do things outside itself. Up front you describe your functions to it - a name, what it's for, and a JSON schema for the inputs. When the model decides it needs one, it doesn't reply in prose, it sends back something like get_weather with city set to Paris. It never executes anything itself: my code runs that function and passes the result back into the conversation, and the model carries on from there. Why it's the foundation: without tools the model is stuck with whatever it learned in training. It can't check today's order status or actually send an email. Tools are what let the loop touch the real world, and once you have that one mechanism, search or memory are basically just more tools you plug in.”

Knew it

Covers the mechanism correctly: typed function definitions, the model returns a structured call, your code executes it. Doesn't mention that selection is probabilistic so validation and permissions belong in your handler, not the prompt.

Missed: Doesn't note that tool selection is probabilistic, so validation, permissions, and rate limits need to live in the handler rather than the prompt.


Get your own answers graded

Sign up free. Your account comes with 50 credits for grading, and it remembers what you missed.

What it covers

All 54 questions

Each on its own page

Agent basics and the agent loop

What makes a system an agent: the reason-act-observe loop, ReAct, the system prompt, workflows versus agents, and when an agent is worth building.

6 questions

  1. What is an AI agent, and how is it different from a single LLM call?
  2. Walk me through the reason-act-observe loop that makes a system agentic.
  3. What is the difference between a deterministic workflow and an agentic workflow?
  4. What is ReAct, and why was it influential?
  5. What role does the system prompt play in an agent?
  6. A product team says "we need an AI agent" for a business process. How do you decide what to actually build? Pro

Tool use, MCP and computer use

How agents act: the tool-call round trip, writing tool definitions, how many tools to expose, parallel calls, structured outputs, MCP, and computer-use and browser agents that drive a GUI when no API exists.

9 questions

  1. What is tool use (function calling), and why is it called the foundation of agents?
  2. Describe the full round trip of one function call between your application and the model.
  3. What is the Model Context Protocol (MCP), and what problem does it solve? Pro
  4. What makes a good tool definition, and how would you write its description? Pro
  5. How does parallel tool calling work, and what common mistake silently breaks it? Pro
  6. Why do structured outputs matter inside agent steps, and how do the major providers enforce them? Pro
  7. How do you decide which tools and how many to expose to an agent, and what goes wrong with too many? Pro
  8. How do computer-use agents work, and why are they harder to build reliably than API-based agents? Pro
  9. Compare DOM-based and vision-based browser agents. What risks do browser agents introduce? Pro

Reasoning and workflow patterns

How an agent plans and improves its work: ReAct versus plan-then-execute, reflection, chaining, routing, evaluator-optimizer and agentic RAG.

4 questions

  1. Compare ReAct-style interleaved reasoning with plan-then-execute. When does each win? Pro
  2. What is reflection in agent design, and when does it actually pay off? Pro
  3. Beyond the supervisor, what orchestration patterns should an engineer know? Pro
  4. What is agentic RAG, and how does it differ from classic retrieval-augmented generation? Pro

Memory and context management

What goes into the context window and what is stored outside it: memory types, context engineering, compaction, subagent isolation and long-term memory.

7 questions

  1. What kinds of memory can an agent have? Pro
  2. Why do long-running agents exhaust their context, and what are the main mitigations? Pro
  3. What are subagents, and how do they help with context management? Pro
  4. What is context engineering, and why is it considered the successor to prompt engineering for agents? Pro
  5. Design a long-term memory system for an agent. What are write policies and why do they matter? Pro
  6. How does context compaction work, and what must be preserved for it to be safe? Pro
  7. How would you manage context for an agent that works over several days? Pro

Multi-agent systems

Splitting work across agents: supervisors, handoffs, how agents communicate including A2A, and when multi-agent is worth its extra cost.

5 questions

  1. What is a multi-agent system, and why do most teams start with a single agent? Pro
  2. Describe the supervisor (orchestrator-workers) pattern and its failure points. Pro
  3. What are handoffs in the OpenAI Agents SDK, and how do they differ from a supervisor calling subagents as tools? Pro
  4. How do agents in a multi-agent system communicate, and where does Google's A2A protocol fit? Pro
  5. When does a multi-agent architecture actually beat a single agent, given that it multiplies token cost? Pro

Agent frameworks and SDKs

The main agent frameworks and SDKs (LangGraph, CrewAI, AutoGen, the OpenAI and Claude SDKs), how to choose one, and when to skip frameworks altogether.

6 questions

  1. Name the major agent frameworks in 2026 and what each is best known for. Pro
  2. When should you skip agent frameworks entirely, and what does the no-framework version look like? Pro
  3. How does LangGraph model an agent, and what do checkpointing and interrupts buy you? Pro
  4. What does the Claude Agent SDK give you beyond the raw Anthropic API, and when would you use each? Pro
  5. What are the core primitives of the OpenAI Agents SDK, and how do they compose? Pro
  6. Compare LangGraph, CrewAI, and AutoGen (Microsoft Agent Framework). How do you choose? Pro

Reliability and durable execution

Keeping agents correct over time: tool failures, idempotency, stopping endless loops, common failure modes, streaming, resuming and runs that survive crashes.

6 questions

  1. How should an agent handle a failing tool call? Pro
  2. Why does idempotency matter for agent tools, and how do you achieve it? Pro
  3. How do you prevent an agent from looping forever? Pro
  4. What are the classic failure modes of deployed agents, and how do you mitigate each? Pro
  5. How do you handle streaming, long turns, and resumability in an agent's execution? Pro
  6. How would you make an agent that runs for hours or days durable against crashes, deploys, and restarts? Pro

Evaluation, observability and cost

Measuring and running agents in production: grading trajectories, benchmarks, eval pipelines, tracing, and the levers for cost and latency.

5 questions

  1. How does evaluating an agent differ from evaluating a single-prompt LLM feature? Pro
  2. Which benchmarks are commonly used for agents, and what does each actually measure? Pro
  3. What does observability look like for an agent in production? Pro
  4. What levers do you have to control an agent's cost and latency? Pro
  5. How do you build an evaluation pipeline for non-deterministic agent trajectories at scale? Pro

Security, guardrails and human oversight

Keeping agents safe: approval gates, sandboxing and permissions, prompt injection, guardrails, vetting MCP servers and handling production credentials.

6 questions

  1. What is human-in-the-loop in agent design, and when is an approval gate required? Pro
  2. How do you sandbox and permission an agent's tools? Pro
  3. What is prompt injection in the agent setting, and what is the lethal trifecta? How do you mitigate it? Pro
  4. How do you implement guardrails around a production agent? Pro
  5. What are the security and trust risks of third-party MCP servers, and how would you vet one? Pro
  6. Design the security architecture for an agent that operates with production credentials. Pro
Practice · Questions

All questions

Showing of 54
Beginner 12
01

What is an AI agent, and how is it different from a single LLM call?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

An AI agent is an LLM given a goal, a set of tools, and permission to take several steps on its own. A single LLM call is one turn: text in, text out, then it is over.

Single LLM call Agent
Steps Exactly one Keeps going until the goal is met
Who picks the next action Your code The model, at runtime
Tools None, or one round you handle Called repeatedly, results fed back in
State Stateless Carries context across steps
Cost and latency Predictable Varies run to run

The real difference is control. You trade a predictable path for the ability to handle tasks whose steps are unknown up front. That is why every agent needs step limits, spend budgets, and logs.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

02

Walk me through the reason-act-observe loop that makes a system agentic.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

An agentic system runs a loop: the model reasons about what to do next, acts by calling a tool, then observes the real result. The observation is appended to the context, so the next reason step is better informed. The loop repeats until the model replies with an answer instead of a tool call.

while True:
    step = model(messages)              # reason: decide the next action
    if not step.tool_calls:
        return step.text                # model answers -> loop ends
    result = run_tool(step.tool_calls)  # act
    messages += [step, result]          # observe: real output back into context

Two things make this agentic. The observation is ground truth from a live system, not the model's guess. And the model, not your code, picks each next step. An error is just another observation, so the model can retry with different arguments.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

03

What is tool use (function calling), and why is it called the foundation of agents?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Tool use, also called function calling, lets you hand the model a list of typed function definitions. The model never runs code. It returns a structured request that names one tool and its arguments. Your code runs it and passes the result back.

{ "type": "tool_use", "name": "get_order", "input": { "order_id": "A-1187" } }

It is the foundation because a raw model can only produce text from what it learned in training. Tools give it fresh reads of the world and real writes to it. Almost every other agent capability ships as just another tool: retrieval, memory, even calling another agent.

The tradeoff is that the model decides but your code executes. Tool selection is probabilistic, so validation, permissions and rate limits belong in your handler, never in the prompt.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

04

Describe the full round trip of one function call between your application and the model.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

One function call takes two API calls, not one. The model never runs your code. It only asks you to run it, and you send the result back.

1. Your app sends the messages plus the tool schemas
2. Model replies with a tool_use block: name, input, and an id
   (stop_reason "tool_use" - no final text yet)
3. Your app runs the real function
4. Your app appends that assistant turn, then a user turn holding a
   tool_result block whose tool_use_id matches the same id
5. Resend the whole message list; the model reads the result and answers

Two details prove you have built this. The API is stateless and remembers nothing between calls, so step 5 resends every earlier turn, including the tool_use one. And the ids must pair exactly, or the request is rejected.

OpenAI names the same pieces tool_calls and role: "tool" with tool_call_id. The loop can repeat: the model may ask for another call before it stops.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

05

What is the difference between a deterministic workflow and an agentic workflow?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A deterministic workflow has its steps fixed in code, so every run follows the same path. An agentic workflow lets the model pick the next step at runtime, so the path changes with the input.

Deterministic workflow Agentic workflow
Picks the next step Your code The model
Path across runs Same Varies
Testing Assert on the output Judge the whole trajectory
Cost and latency Predictable Open-ended
Best for Known, stable steps Branching, open-ended tasks

The trade-off is control versus flexibility. Fixed steps buy repeatable runs, cheap debugging, and a predictable bill. Agency handles cases you never listed.

Most production systems mix both: a fixed pipeline with one agentic step where the branching is unknown. Start deterministic, and add agency only where fixed logic keeps failing.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

06

What is ReAct, and why was it influential?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

ReAct, short for Reasoning and Acting, is a prompting pattern from a 2022 paper by Yao et al. It makes one model interleave short reasoning steps with tool actions in a single trace.

Thought: I need Acme's current CEO.
Action: search("Acme CEO")
Observation: Jane Doe, since 2024.
Thought: That answers it.
Answer: Jane Doe.

It was influential because it joined two things that were separate. Chain-of-thought, where the model writes its reasoning out loud, could plan but not check facts. Tool-using systems could act but not plan. ReAct grounds each reasoning step in a real observation, so wrong turns get caught mid-task.

Today most agents run this shape through native tool-calling APIs instead of parsing Thought: and Action: text.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

07

What role does the system prompt play in an agent?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

The system prompt is the agent's standing instructions. It is the one block of context that stays fixed while the reason-act-observe loop rewrites everything else.

It sets the role and scope, the policy for using tools, and the rule for when to stop and answer.

Role and scope:   what you are; what you must refuse
Tool policy:      search before answering; never write without approval
Stopping rule:    stop when the task is done; ask if inputs are missing
Output format:    short markdown; cite the file you read

Two things matter in practice. Keep it stable, because a fixed prefix is what prompt caching can reuse. Keep it small: durable policy belongs here, and per-task detail belongs in the user message.

It steers the model but enforces nothing. Text arriving from a tool can still argue against it.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

08

What is the Model Context Protocol (MCP), and what problem does it solve?

Part of Pro
09

What kinds of memory can an agent have?

Part of Pro
10

What is a multi-agent system, and why do most teams start with a single agent?

Part of Pro
11

What is human-in-the-loop in agent design, and when is an approval gate required?

Part of Pro
12

Name the major agent frameworks in 2026 and what each is best known for.

Part of Pro
Intermediate 24
13

What makes a good tool definition, and how would you write its description?

Part of Pro
14

How does parallel tool calling work, and what common mistake silently breaks it?

Part of Pro Visual
15

Why do structured outputs matter inside agent steps, and how do the major providers enforce them?

Part of Pro
16

Compare ReAct-style interleaved reasoning with plan-then-execute. When does each win?

Part of Pro
17

What is reflection in agent design, and when does it actually pay off?

Part of Pro
18

Describe the supervisor (orchestrator-workers) pattern and its failure points.

Part of Pro
19

What are handoffs in the OpenAI Agents SDK, and how do they differ from a supervisor calling subagents as tools?

Part of Pro Visual
20

Beyond the supervisor, what orchestration patterns should an engineer know?

Part of Pro
21

Why do long-running agents exhaust their context, and what are the main mitigations?

Part of Pro
22

What are subagents, and how do they help with context management?

Part of Pro
23

How should an agent handle a failing tool call?

Part of Pro
24

Why does idempotency matter for agent tools, and how do you achieve it?

Part of Pro
25

How do you prevent an agent from looping forever?

Part of Pro
26

How does evaluating an agent differ from evaluating a single-prompt LLM feature?

Part of Pro
27

Which benchmarks are commonly used for agents, and what does each actually measure?

Part of Pro
28

What does observability look like for an agent in production?

Part of Pro
29

What levers do you have to control an agent's cost and latency?

Part of Pro Visual
30

When should you skip agent frameworks entirely, and what does the no-framework version look like?

Part of Pro
31

How do you decide which tools and how many to expose to an agent, and what goes wrong with too many?

Part of Pro
32

What is agentic RAG, and how does it differ from classic retrieval-augmented generation?

Part of Pro
33

What is context engineering, and why is it considered the successor to prompt engineering for agents?

Part of Pro
34

How does LangGraph model an agent, and what do checkpointing and interrupts buy you?

Part of Pro
35

What does the Claude Agent SDK give you beyond the raw Anthropic API, and when would you use each?

Part of Pro
36

What are the core primitives of the OpenAI Agents SDK, and how do they compose?

Part of Pro
Expert 18
37

Compare LangGraph, CrewAI, and AutoGen (Microsoft Agent Framework). How do you choose?

Part of Pro
38

How do computer-use agents work, and why are they harder to build reliably than API-based agents?

Part of Pro
39

Compare DOM-based and vision-based browser agents. What risks do browser agents introduce?

Part of Pro
40

How do you sandbox and permission an agent's tools?

Part of Pro Visual
41

What is prompt injection in the agent setting, and what is the lethal trifecta? How do you mitigate it?

Part of Pro
42

Design a long-term memory system for an agent. What are write policies and why do they matter?

Part of Pro
43

How does context compaction work, and what must be preserved for it to be safe?

Part of Pro Visual
44

How do agents in a multi-agent system communicate, and where does Google's A2A protocol fit?

Part of Pro
45

How do you implement guardrails around a production agent?

Part of Pro
46

What are the classic failure modes of deployed agents, and how do you mitigate each?

Part of Pro
47

How do you handle streaming, long turns, and resumability in an agent's execution?

Part of Pro
48

What are the security and trust risks of third-party MCP servers, and how would you vet one?

Part of Pro
49

A product team says "we need an AI agent" for a business process. How do you decide what to actually build?

Part of Pro
50

When does a multi-agent architecture actually beat a single agent, given that it multiplies token cost?

Part of Pro
51

How would you make an agent that runs for hours or days durable against crashes, deploys, and restarts?

Part of Pro Visual
52

How do you build an evaluation pipeline for non-deterministic agent trajectories at scale?

Part of Pro
53

Design the security architecture for an agent that operates with production credentials.

Part of Pro
54

How would you manage context for an agent that works over several days?

Part of Pro

No matches

Try a different filter or search term.

Know someone prepping for AI Agents? Send them this set.
Quick recap

AI Agents in pictures.

A quick recap of AI Agents in 38 short animated pictures, one idea at a time. About 10 min to get the whole topic back in your head before you walk in. Pause any picture, slow it down, or step through it.

Pro The first chapter is free to play. The other 34 pictures come with Pro.

Get Pro · $10/mo
Pro · $10/mo

47 of 54 AI Agents answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

Serverless on AWS

Serverless Architecture on AWS

Flutter Mobile

Flutter Cross-Platform Mobile Development

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

AI Engineer

LLMs, RAG, Agents, Evals

AI-Powered Developer

Claude Code, Copilot, Agentic Workflows

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git