16 Agents & Workflows Practice Questions & Answers
Every Agents & Workflows practice question from the Claude Certified Developer – Foundations Practice Test, with the correct answer and a short explanation.
Start practice test →1. A team is building a document-processing pipeline that always runs the same three steps: extract fields from an insurance form, classify the claim type, then generate a summary. The steps never vary. According to Anthropic's guidance on building effective agents, which architecture best fits?
- A.A fully autonomous agent that decides its own steps with all tools available
- B.A workflow that chains the LLM calls through predefined code paths✓ Answer
- C.An agent with persistent memory so it can learn the steps over time
- D.An orchestrator agent that spawns subagents to plan the pipeline dynamically
Anthropic defines workflows as systems where LLMs and tools are orchestrated through predefined code paths, and recommends them when the task decomposes into fixed, well-defined steps because they deliver predictability and consistency at lower cost. Agents, which dynamically direct their own process, add latency, cost, and unpredictability that this fixed pipeline does not need.
Source: Anthropic, "Building Effective Agents" — Workflows vs. agents definitions; CCDV-F Exam Guide Domain 1, Agent ArchitectureReport a problem with this question
2. A developer needs Claude to resolve arbitrary bug reports in a large codebase. Which files must be read, which tests must run, and how many steps are needed cannot be known in advance. Which architecture is the appropriate choice?
- A.A single LLM call with the entire codebase pasted into the prompt
- B.A routing workflow that sends each bug to one of several fixed handlers
- C.A prompt-chaining workflow with a fixed sequence of LLM calls
- D.An agent that dynamically directs its own tool use in a loop until the task is done✓ Answer
Anthropic recommends agents for open-ended problems where the number of steps and the path cannot be predicted or hardcoded: the model plans, calls tools, observes results, and iterates based on environmental feedback. Fixed workflows (chaining or routing) require the path to be known in advance, and pasting an entire large codebase into one call is infeasible within a context window and provides no ability to run tests.
Source: Anthropic, "Building Effective Agents" — When (and when not) to use agents; CCDV-F Exam Guide Domain 1, Agent ArchitectureReport a problem with this question
3. A product team is designing its first Claude-powered feature and is debating between a multi-agent system and simpler options. Per Anthropic's core recommendation for building with LLMs, what should the team do first?
- A.Find the simplest solution that works — often a single optimized LLM call — and add agentic complexity only when it measurably improves outcomes✓ Answer
- B.Start with a multi-agent hierarchy, since production systems eventually need one
- C.Build a custom agent harness first, because frameworks hide too much detail
- D.Adopt an agentic framework immediately so the architecture can scale later
Anthropic's guidance is to find the simplest solution possible and only increase complexity when needed, because agentic systems trade latency and cost for better task performance; a single LLM call with retrieval and good examples is often enough. Starting with multi-agent systems, frameworks, or custom harnesses before proving the need adds cost and debugging burden without demonstrated benefit.
Source: Anthropic, "Building Effective Agents" — "find the simplest solution possible" principle; CCDV-F Exam Guide Domain 1, Agent ArchitectureReport a problem with this question
4. In a manager/supervisor (orchestrator-workers) architecture, what distinguishes it from a simple parallelization workflow?
- A.The orchestrator executes every tool call itself instead of delegating
- B.Worker LLMs vote on each other's answers and the majority response wins
- C.A central LLM dynamically decides how to break down the task, delegates subtasks to worker LLMs, and synthesizes their results✓ Answer
- D.The subtasks are fixed in application code and always run concurrently
The defining feature of the orchestrator-workers pattern is that the subtasks are not predefined: the orchestrator LLM determines the decomposition at runtime based on the specific input, delegates to workers, and synthesizes the results. In a parallelization workflow, by contrast, the subtasks and their fan-out are fixed in code before execution, which is why the orchestrator pattern suits tasks whose required subtasks vary per request.
Source: Anthropic, "Building Effective Agents" — Orchestrator-workers workflow; CCDV-F Exam Guide Domain 1, Agent Architecture (manager/supervisor hierarchies)Report a problem with this question
5. A lead agent delegates a large research task to several subagents. From a context-engineering perspective, what is the primary benefit of using subagents here?
- A.Each subagent works in its own isolated context window and returns only a condensed result, keeping the lead agent's context clean while enabling parallel exploration✓ Answer
- B.Subagent tokens are not billed, so delegation reduces cost to zero
- C.Subagents enlarge the model's maximum context window for the whole session
- D.Subagents share the parent's context window, so all agents see the full history
Subagents provide context isolation: each one performs its verbose exploration (searches, file reads, tool output) inside its own context window and passes back only a summarized result, so the lead agent's context does not fill with intermediate noise, and independent subtasks can run in parallel. They do not share the parent's window, do not change the model's context limit, and their tokens are billed normally.
Source: Claude Agent SDK documentation — Subagents (context isolation and parallelization); CCDV-F Exam Guide Domain 1, Agent ArchitectureReport a problem with this question
6. A team currently calls the Messages API directly and has hand-written its own tool-execution loop, file-editing tools, permission checks, and context compaction. What is the main value of migrating to the Claude Agent SDK?
- A.It lets the team fine-tune Claude on their proprietary data
- B.It provides the production agent harness that powers Claude Code — the agent loop, built-in tools, permission system, context management, subagents, and hooks — so the team stops rebuilding infrastructure✓ Answer
- C.It is a prompt template library with no runtime components
- D.It is only a hosting service that runs the team's existing loop on Anthropic servers
The Claude Agent SDK (Python and TypeScript) exposes the same battle-tested harness that runs Claude Code: an agent loop that gathers context and executes tools, built-in file/bash/web tools, fine-grained permissions, automatic context management, subagents, and hooks. Its purpose is precisely to replace hand-rolled loops and plumbing; it is not a fine-tuning product, a hosting-only service, or a mere prompt library.
Source: Claude Agent SDK overview (docs.claude.com/en/api/agent-sdk/overview); CCDV-F Exam Guide Domain 1, Agent Construction with ClaudeReport a problem with this question
7. An agent built with the Claude Agent SDK runs a multi-hour refactoring task and its conversation approaches the model's context limit. What does the SDK do by default?
- A.It silently deletes the system prompt to free space
- B.It automatically compacts the conversation, summarizing earlier messages so the agent can keep working without overflowing the window✓ Answer
- C.It transparently switches to a different model with a larger context window
- D.It throws a hard error and the task must be restarted from scratch
Automatic context management is a core Agent SDK feature: as the conversation nears the context limit, the SDK compacts it by summarizing older messages while preserving the information needed to continue, which is what makes long-running agent tasks feasible. It does not delete the system prompt, swap models on its own, or simply fail.
Source: Claude Agent SDK documentation — automatic context management/compaction; CCDV-F Exam Guide Domain 1, Agent Patterns (context-window management)Report a problem with this question
8. A developer must guarantee that a coding agent can never execute destructive shell commands such as recursive deletes, even if the model decides to try one. Which mechanism satisfies this requirement, and why?
- A.Set temperature to 0 so the model behaves more predictably
- B.Add a strongly worded rule to the system prompt telling the model never to run destructive commands
- C.A PreToolUse hook that inspects each command and blocks dangerous ones, because hooks run as deterministic code outside the model's discretion✓ Answer
- D.Ask the model to double-check its own commands before running them
Prompt instructions, low temperature, and self-review all depend on the model choosing to comply, so none of them can provide a guarantee. Hooks are deterministic code that the harness itself executes at defined lifecycle points; a PreToolUse hook intercepts every tool invocation before it runs and can programmatically deny it, making the control enforceable regardless of what the model outputs.
Source: Claude Agent SDK documentation — Hooks (deterministic processing); CCDV-F Exam Guide Domain 1, Agent Construction (hooks for deterministic actions) and Domain 7, Claude HooksReport a problem with this question
9. In the Claude Agent SDK hook lifecycle, which hook event fires before a tool call executes and can prevent that execution entirely?
- A.UserPromptSubmit, which fires when the user sends a message
- B.PreToolUse, which receives the pending tool call and can allow or deny it✓ Answer
- C.Stop, which fires when the agent finishes its turn
- D.PostToolUse, which reviews the tool's output after it runs
PreToolUse runs after the model requests a tool but before the harness executes it, and its response can explicitly allow or deny the call — which is why it is the standard place for guardrails against destructive actions. PostToolUse only sees results after execution, and Stop and UserPromptSubmit fire at points in the lifecycle where no pending tool call exists to block.
Source: Claude Agent SDK documentation — Hook events (PreToolUse vs. PostToolUse); CCDV-F Exam Guide Domain 1, Agent Construction with ClaudeReport a problem with this question
10. A healthcare company requires that its Claude agent's execution environment — filesystem, network egress, and logs — run entirely inside the company's own cloud account for compliance. Which deployment model fits?
- A.Run the agent through the claude.ai consumer web interface
- B.Self-host the agent harness (e.g., the Claude Agent SDK) on the company's own infrastructure, calling the model API from within its environment✓ Answer
- C.Use an Anthropic-hosted managed agent, since Anthropic operates the runtime
- D.Fine-tune a model so no runtime environment is needed at all
The self-hosted deployment model exists precisely for cases where the organization must own and control the agent's execution environment — its compute, filesystem access, network policies, and logging — while still calling the Claude model API. An Anthropic-hosted managed agent trades that infrastructure control away for operational simplicity, the consumer web app offers no infrastructure control at all, and fine-tuning does not eliminate the need for a runtime where tools execute.
Source: CCDV-F Exam Guide Domain 1, Agent Construction with Claude — managed agent deployment models (self-hosted vs. Anthropic-hosted)Report a problem with this question
11. A developer writes a custom agent loop directly against the Messages API. On each iteration the code sends the conversation, executes any requested tools, and appends the results. What is the correct condition for exiting the loop?
- A.Exit when the response's stop_reason is no longer tool_use — the model has finished without requesting another tool✓ Answer
- B.Always exit after exactly 10 iterations regardless of state
- C.Exit whenever any tool returns an empty result
- D.Exit as soon as the context window is completely full
The core mechanic of a tool-use loop is the stop_reason field: while it equals tool_use, the model is requesting tool execution and the loop must run the tools and send the results back; when the model responds with a different stop reason such as end_turn, it has produced its final answer and the loop terminates. A fixed iteration count is at most a safety cap, an empty tool result is valid data the model may still need to reason about, and a full context window is a failure condition to manage, not the normal exit signal.
Source: Claude Messages API tool use — stop_reason: "tool_use" loop semantics; CCDV-F Exam Guide Domain 1, Agent Construction (custom agent loops and harnesses)Report a problem with this question
12. In a custom harness, Claude responds with a tool_use block requesting a database query. After the harness runs the query, how must the result be returned to the model?
- A.Append the result to the system prompt and resend the conversation
- B.Start a fresh conversation containing only the query result
- C.Send the result as an assistant-role message so it looks like the model produced it
- D.Send a new user-role message containing a tool_result block whose tool_use_id matches the model's tool_use request✓ Answer
The tool-use protocol requires the harness to preserve the assistant message containing the tool_use block and then reply with a user-role message holding a tool_result block that references the same tool_use_id, so the model can pair each result with the exact request it made. Putting results in the system prompt or an assistant message breaks that pairing, and starting a new conversation discards the reasoning state the agent needs.
Source: Claude Messages API tool use — tool_result content block and tool_use_id pairing; CCDV-F Exam Guide Domain 1, Agent Construction (custom agent loops and harnesses)Report a problem with this question
13. An agent must work on a project across many sessions spanning several days, and important decisions from early sessions must remain available even though each session starts with a fresh context window. Which agent pattern addresses this?
- A.A memory pattern: the agent persists key decisions and state to external storage (e.g., files or a database) and reads them back into context in later sessions✓ Answer
- B.Set temperature to 0 so the model reproduces the same decisions every session
- C.Increase max_tokens so the model can produce longer responses
- D.Rely on the model to remember prior API calls, since conversations persist server-side by default
The API is stateless — the model retains nothing between calls unless the developer resends it — so information that must outlive a session has to be persisted outside the context window and reloaded later; that is exactly the memory pattern (e.g., an agent writing notes to files it reads at the start of the next session). max_tokens governs output length only, and temperature 0 affects sampling, not recall.
Source: Claude Agent SDK / agent design docs — memory pattern and stateless Messages API; CCDV-F Exam Guide Domain 1, Agent Patterns (memory)Report a problem with this question
14. A long-running research agent performs dozens of web searches, and its context window is filling up with raw HTML from pages that were already analyzed and are no longer needed. Which context-window management technique directly addresses this?
- A.Start a brand-new conversation for every search, carrying nothing forward
- B.Switch to a smaller model, which uses fewer context tokens for the same text
- C.Prune or compact stale tool results — replace old raw outputs with short summaries while keeping the conclusions that still matter✓ Answer
- D.Raise the temperature so the model focuses on more relevant content
Tool-output pruning and compaction reclaim context space by dropping or summarizing intermediate results that have already served their purpose, while preserving the distilled findings the agent still needs — the standard remedy for context bloat in long-running agents. Temperature does not affect what occupies the window, token count for a given text is a property of the tokenizer rather than model size, and discarding all prior context loses the accumulated findings the task depends on.
Source: CCDV-F Exam Guide Domain 1, Agent Patterns (context-window management) and Domain 6, Context Engineering (tool output pruning, compaction)Report a problem with this question
15. A team must implement a compliance-review workflow with explicitly modeled states, conditional branches, cycles between review stages, and the ability to checkpoint and resume mid-run. They want a framework whose core abstraction matches this design. Which fits best?
- A.The raw Messages API with no framework, since graphs cannot be built on top of it
- B.LangGraph, because it models applications as stateful graphs with nodes, conditional edges, cycles, and built-in checkpointing✓ Answer
- C.Strands, because its philosophy is a minimal model-driven loop with little explicit structure
- D.PydanticAI, because its core abstraction is type-validated model outputs
LangGraph's core abstraction is a stateful graph: the developer declares nodes, conditional edges, and cycles over a shared state object, and the runtime provides checkpointing/persistence so execution can pause and resume — a direct match for an explicitly structured, resumable review workflow. PydanticAI centers on typed output validation and Strands on a minimal model-driven loop, so neither makes the graph structure a first-class abstraction; and while one could hand-build all of this on the raw API, the question asks which framework's core abstraction matches.
Source: LangGraph documentation — stateful graph, conditional edges, checkpointing; CCDV-F Exam Guide Domain 1, Agent Patterns and Frameworks (Strands, LangGraph, PydanticAI)Report a problem with this question
16. A Python team building on Claude wants every agent response validated against typed schemas (dataclass-like models), with validation errors automatically fed back to the model for retry. Which agentic framework is designed around exactly this capability?
- A.Parsing responses with regular expressions inside a custom loop
- B.PydanticAI, which builds agents around Pydantic models so outputs are schema-validated and validation failures trigger automatic model retries✓ Answer
- C.Strands, whose central abstraction is a minimal model-driven agent loop
- D.LangGraph, whose central abstraction is graph-based state machines
PydanticAI's defining feature is bringing Pydantic's type-validation model to agents: output types are declared as Pydantic models, every response is parsed and validated against the schema, and on validation failure the error is returned to the model so it can correct itself — giving type-safe structured output without hand-written parsing. LangGraph and Strands center on orchestration structure rather than typed validation, and regex parsing is brittle and provides no automatic retry-on-error mechanism.
Source: PydanticAI documentation — typed output validation with automatic retries; CCDV-F Exam Guide Domain 1, Agent Patterns and Frameworks (Strands, LangGraph, PydanticAI)Report a problem with this question
Practice questions based on the official Claude Certified Developer – Foundations (CCDV-F) exam guide and Anthropic's public documentation. This is an independent study tool, not affiliated with or endorsed by Anthropic, and does not grant certification. The real exam is 53 questions, 120 minutes, passing at a scaled 720/1000, delivered via Pearson VUE ($125). Official certification page →