← Back

22 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. 1. A payments team runs a nightly reconciliation job: pull the day's ledger entries, normalize them, compare against the bank file, and email a variance report. The four steps are always the same, in the same order, and auditors require the run to be reproducible. Which architecture fits best?

    • A.A multi-agent network in which each step is a peer agent that messages the others
    • B.A workflow: the model calls are orchestrated through predefined code paths that your code controlsAnswer
    • C.A single model call with the whole ledger pasted into the prompt and no tools
    • D.An autonomous agent that decides each night which steps to run and in what order

    A workflow is defined as LLMs and tools orchestrated through predefined code paths, while an agent dynamically directs its own process. Because the steps here are known and fixed and the business requires determinism, reproducibility and auditability, the control flow belongs in code — handing that decision to a model would add latency, cost and non-determinism with no offsetting benefit.

    Source: Anthropic docs — Building Effective Agents: workflows vs. agentsReport a problem with this question

  2. 2. Which task most clearly justifies building an agent rather than a code-orchestrated workflow?

    • A.Converting a fixed list of invoice PDFs into rows of a spreadsheet
    • B.Translating a product description into eight languages
    • C.Diagnosing and fixing a failing test suite in an unfamiliar repository, where the number and order of investigation steps cannot be known in advance and a failing patch can be caught by the testsAnswer
    • D.Rewriting each incoming support email in a friendlier tone before an agent reads it

    The four criteria for reaching for an agent are complexity (the task cannot be fully specified in advance), value (the outcome justifies higher cost and latency), viability (the model is capable at this task type), and cost of error (mistakes can be caught and recovered). Debugging an unfamiliar repository satisfies all four — the step sequence is genuinely unpredictable and the test suite provides environmental ground truth that catches bad changes. The other three are single-pass transformations that need no tool round trip at all.

    Source: Anthropic docs — Agent design: should I build an agent?Report a problem with this question

  3. 3. A developer wraps every model call in the application — including a plain "summarize this article" endpoint — in a while loop that inspects stop_reason and executes tools. What is the problem with doing this for the summarization endpoint?

    • A.stop_reason is not populated on requests that declare no tools, so the loop cannot exit
    • B.The loop will never terminate because summarization never returns end_turn
    • C.Tool results must be returned even when no tools are defined, so the loop will error
    • D.Summarization needs no tool round trip, so the loop adds code and latency without ever executing a tool — a single call is the right shapeAnswer

    The guidance is to find the simplest solution that works and add complexity only when it demonstrably improves outcomes. Summarization, translation and general-knowledge answers are single-call tasks: no external ground truth is needed, so no tool round trip is warranted, and on trivial tasks the tool-loop overhead can exceed the work itself. The loop is not broken — a no-tool request simply returns end_turn on the first pass — it is just unnecessary machinery.

    Source: Anthropic docs — Agent design: start simpleReport a problem with this question

  4. 4. A marketing team generates campaign copy in three stages: draft the outline, expand it into copy, then localize it. Between stage one and stage two, plain code checks that the outline contains the required legal disclaimer and rejects it back to stage one if not. Which pattern is this?

    • A.Orchestrator-workers, because three model calls are coordinated
    • B.Prompt chaining with a programmatic gate between stepsAnswer
    • C.Evaluator-optimizer, because a check runs between generations
    • D.Parallelization by voting, because the outline may be produced more than once

    Prompt chaining decomposes a task into a fixed sequence of steps in which each call processes the previous output, optionally with programmatic gates between steps that validate before continuing. The discriminator against evaluator-optimizer is that the check here is deterministic code enforcing a known rule, not a second LLM giving iterative qualitative feedback; and the discriminator against orchestrator-workers is that the steps are predefined rather than decided by a model at runtime.

    Source: Anthropic docs — Building Effective Agents: prompt chainingReport a problem with this question

  5. 5. An inbound support queue mixes password resets, billing disputes and API integration questions. Each category is handled best by a different prompt, and the password resets are simple enough for a cheaper, faster model. Which pattern fits?

    • A.Evaluator-optimizer
    • B.Autonomous agent with a stopping condition
    • C.Parallelization by sectioning: run all three specialist prompts concurrently and merge
    • D.Routing: classify the input, then dispatch it to the specialized follow-up prompt or modelAnswer

    Routing classifies an input into distinct categories and dispatches each to a follow-up prompt or model specialized for it — which also lets easy categories go to a cheaper or faster model without degrading the hard ones. Sectioning is wrong here because the three categories are mutually exclusive: running all three specialists on every ticket would triple cost for two discarded answers rather than dividing one task into genuinely independent subtasks.

    Source: Anthropic docs — Building Effective Agents: routingReport a problem with this question

  6. 6. Team A answers a user's question with one model call while a second concurrent call screens the same input for policy violations. Team B sends the same code diff to five identical review calls and aggregates how many flag a vulnerability. Which parallelization variants are these, in order?

    • A.Both are voting; only the aggregation rule differs
    • B.Sectioning, then votingAnswer
    • C.Both are sectioning; only the number of calls differs
    • D.Voting, then sectioning

    Sectioning splits a task into independent subtasks run concurrently — answering and policy-screening are different jobs on the same input, giving speed and separation of concerns. Voting runs the same task multiple times to get diverse outputs that are then aggregated, which is how you build confidence on a judgment call such as whether a diff contains a vulnerability. The discriminator is whether the concurrent calls do different work (sectioning) or the same work repeatedly (voting).

    Source: Anthropic docs — Building Effective Agents: parallelization (sectioning and voting)Report a problem with this question

  7. 7. A code-migration system receives a request such as "move this service off the deprecated auth library." A central model reads the repository, decides at runtime which files need changing and how many sub-tasks that implies, dispatches those sub-tasks, then synthesizes the results. What distinguishes this from parallelization?

    • A.It is the only pattern in which results are aggregated at the end
    • B.It requires the subtasks to run sequentially rather than concurrently
    • C.It always uses more model calls than parallelization does
    • D.The subtasks are determined dynamically by the model at runtime rather than being predefined by your codeAnswer

    This is orchestrator-workers. Parallelization also fans work out and merges it, but its subtasks are fixed by the developer before the run; in orchestrator-workers a central model decomposes the task at runtime, so neither the number nor the shape of the subtasks is known in advance. That runtime decomposition is precisely what makes it the agentic member of the pair, and why it costs more to trace and audit.

    Source: Anthropic docs — Building Effective Agents: orchestrator-workersReport a problem with this question

  8. 8. In a custom agent loop on the Messages API, the model returns a response containing a short text block and two tool_use blocks. Before returning the tool results, what must be appended to the message list?

    • A.Nothing — the tool_result user message alone is sufficient
    • B.Only the text block, since tool_use blocks are re-derived by the API from the tool results
    • C.The assistant message carrying the entire content block list exactly as received, text and tool_use blocks togetherAnswer
    • D.A summary of what the assistant said, to keep the conversation compact

    The loop must append the assistant turn's full content list, not just its text. The tool_result blocks you send back are matched to the tool_use blocks by id, so if the tool_use blocks are dropped or replaced with a summary there is nothing for the results to pair with and the request is rejected. Preserving the content verbatim is also what keeps other model-internal block types intact across turns.

    Source: Anthropic docs — Implement tool use: appending the assistant turnReport a problem with this question

  9. 9. A team's agent loop exits when the assistant's text contains "I have completed" or after ten iterations, whichever comes first. Why is this considered an anti-pattern?

    • A.Text parsing is fine, but the phrase must be matched case-insensitively
    • B.Ten iterations is too few; the correct fixed count depends on the task
    • C.Iteration caps are never acceptable in production agent loops
    • D.stop_reason is the authoritative termination signal; phrasing varies between responses and an iteration cap is a safety guardrail, not the control signalAnswer

    The canonical loop branches on stop_reason: while it is tool_use you execute tools and resend; any other value ends the loop. Matching on assistant prose is brittle because the model's phrasing is not contractual and changes across responses, so a loop keyed to a phrase will silently break in production. An iteration cap is still worth having, but as a runaway guardrail layered on top of the stop_reason check, not as the primary exit condition.

    Source: Anthropic docs — Handling stop reasons in an agent loopReport a problem with this question

  10. 10. An agent that declares a server-side tool receives a response whose stop_reason is pause_turn. What is the correct handling?

    • A.Re-send the conversation with the paused assistant response appended, so the model continues where it left offAnswer
    • B.Discard the paused response and retry the original user message from scratch
    • C.Treat it as end_turn and return the partial answer to the user
    • D.Append a new user message saying "Continue." to prompt the model onward

    Server-side tools run their sampling loop on Anthropic's infrastructure with an internal iteration limit; hitting it produces pause_turn, which means the turn is unfinished, not complete. The fix is to append the paused assistant response to the message list and re-send — the API detects the trailing server-tool block and resumes automatically. Adding a synthetic "Continue." user message is unnecessary and injects text into the conversation that the model never needed, and retrying from scratch discards work already paid for.

    Source: Anthropic docs — Handling stop reasons: pause_turnReport a problem with this question

  11. 11. One assistant turn contains three tool_use blocks, which your harness executes concurrently. How must the results be returned?

    • A.In any order and any grouping, since the API matches results to calls by tool name
    • B.As three user messages, one per tool, in the order the tools finished
    • C.As a single user message containing three tool_result blocks, each carrying the tool_use_id of the tool_use block it answersAnswer
    • D.As a single assistant message containing the three results concatenated as text

    Every tool_use block in a turn needs exactly one matching tool_result, and all of them must arrive together in the single user message that immediately follows the assistant turn. Pairing is by tool_use_id, not by tool name or position — which matters precisely when the same tool is called more than once in one turn. Omitting a result produces the error that tool_use ids were found without tool_result blocks immediately after.

    Source: Anthropic docs — Messages API tool use: returning tool resultsReport a problem with this question

  12. 12. A team notices that their agent, which used to request several tools at once, now almost always requests them one at a time. Reviewing the harness, they find it sends each tool_result in its own separate user message. Why does this matter?

    • A.Splitting parallel results across messages teaches the model that its parallel calls were not honored, suppressing future parallel tool useAnswer
    • B.Each extra user message resets the conversation history, so the model forgets the earlier calls
    • C.Tool results are only valid in the first user message, so later ones are ignored entirely
    • D.Separate messages are rejected by the API, so the agent is silently falling back to one call per turn

    The conversation history is the model's evidence about how the environment behaves. When results from one parallel turn are split across several user messages, the transcript no longer looks like a turn whose parallel calls were answered together, and the model learns from that shape to stop issuing parallel calls — a silent behavioral regression rather than a hard error. Returning all results in one user message preserves the parallel pattern.

    Source: Anthropic docs — Messages API tool use: parallel tool useReport a problem with this question

  13. 13. During an agent run, a tool call to an external API fails with a rate-limit error. What should the harness send back?

    • A.An exception raised out of the loop so the run aborts and can be restarted
    • B.Nothing for that call, and only the results of the tools that succeeded
    • C.A tool_result whose content is the single word "failed"
    • D.A tool_result with is_error set to true and an instructive message such as "Rate limit exceeded. Retry after 60 seconds."Answer

    Tool failures are signalled inside the contract, not by breaking it: return the tool_result with is_error true so the model knows the call did not succeed. The message content is what the model reasons over to recover, so an instructive message that names the failure and the remedy lets it wait and retry or choose another path, whereas a bare "failed" gives it nothing to act on. Dropping the result entirely leaves a tool_use block unanswered and is rejected, and crashing the loop discards recoverable state.

    Source: Anthropic docs — Implement tool use: error handling with is_errorReport a problem with this question

  14. 14. You want to return two tool results and also add a short note of your own for the model to read in the same user message. How must that message be ordered?

    • A.Both tool_result blocks first, then the text blockAnswer
    • B.Text is not permitted in any message that contains tool_result blocks
    • C.Interleaved: text, result, text, result
    • D.The text block first, then both tool_result blocks

    Within a user message that answers a tool-use turn, all tool_result blocks must come first and any text must follow them; putting text before a tool_result is a request error. This ordering keeps the results immediately adjacent to the assistant turn they answer. Note the related constraint that when the assistant turn also left a server-side tool call unresolved, the reply must contain only tool_result blocks — adding text there ends the turn early and is rejected.

    Source: Anthropic docs — Messages API tool use: tool_result block orderingReport a problem with this question

  15. 15. A platform team is choosing between an SDK tool-runner helper that drives the loop over tools you define, and a full coding-agent SDK that ships its own built-in file and shell tools. Which statement is accurate?

    • A.The tool runner provides managed hosting, while the coding-agent SDK must be self-hosted
    • B.Both supply only the harness — you still host and deploy them yourself; managed hosting is a separate offering in which the provider runs both the loop and the sandboxAnswer
    • C.They are the same library under two names, so the choice is purely stylistic
    • D.The coding-agent SDK cannot be extended with tools you define yourself

    Two independent questions separate these options: who supplies the harness (loop plus context management) and who supplies the deployment. The tool runner and the coding-agent SDK both supply a harness only and differ in its scope — the tool runner loops over tools you define with no built-in tools, while the coding-agent SDK ships read, write, edit, shell and search tools — but you host and deploy either one. Only a managed-agent offering adds deployment, running the agent loop and a per-session sandbox on the provider's side.

    Source: Anthropic docs — Agent development: building an agent, approaches comparedReport a problem with this question

  16. 16. A compliance requirement states that the agent must never run a shell command containing a destructive delete, with no exceptions. The team has written a firmly worded system-prompt rule and it usually holds. What is the correct way to make this deterministic?

    • A.Lower the model's effort setting so it takes fewer risky actions
    • B.Add an instruction in every user message reminding the model of the rule
    • C.Enforce it programmatically outside the model — a pre-execution hook or permission rule that inspects the call and blocks it before the tool runsAnswer
    • D.Repeat the rule at both the start and end of the system prompt and put it in capitals

    A system-prompt instruction is a strong prior, not a guarantee — it has a non-zero failure rate, so it cannot satisfy a requirement stated as "never, with no exceptions." Rules that must hold deterministically belong in the harness: a pre-tool-use hook or a permission rule runs in your process, inspects the concrete tool input, and short-circuits the call before execution. Rewording, repeating or shouting the prompt changes the probability but not the guarantee.

    Source: Anthropic docs — Agent design: harness-level enforcement vs. promptingReport a problem with this question

  17. 17. A coordinator agent delegates a documentation audit to a subagent, mentioning only "audit the docs for the module we discussed." The subagent asks which module. Why?

    • A.The subagent's context was truncated because the parent's history was too long
    • B.The subagent's tool set excludes the tool that would let it read the conversation
    • C.The subagent starts with a fresh context and does not see the parent's conversation, so everything it needs must be passed explicitly in the delegationAnswer
    • D.Subagents cannot read references to earlier turns unless the parent enables history sharing

    Context isolation is the defining property of a subagent: it begins a fresh conversation, loads its own system prompt and project context, and never inherits the parent's turns. That isolation is the benefit — the parent's context grows by a short summary rather than the whole subtask transcript — but it carries an obligation, which is that the delegating prompt must be self-contained. Pronouns and references such as "the module we discussed" resolve to nothing on the other side.

    Source: CCDV-F Exam Guide — Agent Patterns and Frameworks: subagent context isolationReport a problem with this question

  18. 18. Which task is the better candidate for delegating to subagents rather than doing directly in the main loop?

    • A.Applying a migration whose second step depends on the exact output of the first
    • B.Double-checking an answer the main agent has already produced
    • C.Reading one file, editing two lines in it, and running the file's test
    • D.Investigating forty independent modules to find which ones import a deprecated package, where each investigation is self-containedAnswer

    Delegation is not free: each subagent re-establishes its own context, re-explores, and reports back, and the coordinator then reads that report — so the payoff has to exceed that overhead. Wide, genuinely independent fan-out is where it pays, because the work truly parallelizes and the parent's context grows only by the summaries. Work you could finish in a handful of tool calls, strictly sequential work whose next step depends on the last, and verification of your own output are all cheaper and more reliable in the main loop.

    Source: Anthropic docs — Agent design: delegation cost and fan-outReport a problem with this question

  19. 19. An agent is given an important formatting rule in its very first user message. Hours into a long session, after automatic compaction has summarized the older history, the agent stops honoring the rule. What is the durable fix?

    • A.Move the rule into project context that is re-injected on every request, rather than relying on it surviving in the conversation historyAnswer
    • B.Disable compaction so the session never loses any history
    • C.Restate the rule in a longer, more emphatic opening prompt
    • D.Ask the agent to repeat the rule back at the start to commit it to memory

    The context window does not reset between turns within a session — system prompt, tool definitions, history, tool inputs and tool outputs all accumulate — and when it approaches the limit, older history is summarized away. Instructions given early are therefore exactly the ones most at risk of being lost in that summary, no matter how emphatically they were phrased. Rules that must persist belong in project context that is re-injected on every request, so their survival does not depend on the transcript.

    Source: CCDV-F Exam Guide — Agent Patterns and Frameworks: context window management and compactionReport a problem with this question

  20. 20. A team adds a custom search tool to their harness. It only reads an index and has no side effects, yet the harness keeps running it sequentially with every other tool. What is the likely cause?

    • A.Concurrency is decided by the model, not the harness, so no configuration can change it
    • B.The tool was not marked as read-only, and custom tools default to sequential execution because the harness cannot otherwise tell a parallel-safe call from an unsafe oneAnswer
    • C.Custom tools can never run concurrently; only built-in tools can
    • D.Search tools are always treated as state-modifying because they touch an index

    Read-only operations such as reading, globbing and grepping can safely run concurrently, while state-modifying operations such as editing, writing and running shell commands must be serialized. A custom tool is opaque to the harness, so it defaults to sequential unless you declare it read-only — the same reason a broad shell tool forces serialization, since the harness cannot distinguish a parallel-safe grep from an unsafe push inside an arbitrary command string.

    Source: Anthropic docs — Agent design: parallel-safe tools and schedulingReport a problem with this question

  21. 21. An architect must pick a third-party agent framework. Requirement A: the control flow must be written down explicitly as a graph with conditional edges, and a long run must be resumable from a checkpoint after a crash. Requirement B: a separate service must guarantee that model output conforms to a declared type, retrying automatically when validation fails. Which framework identities match?

    • A.Both requirements are met only by a model-driven lightweight loop, since the model plans everything
    • B.A: a type-safe validation framework. B: a stateful graph framework
    • C.A: a stateful graph framework with nodes, conditional edges and checkpointing. B: a type-safe framework built on schema validation with automatic retriesAnswer
    • D.Neither requirement can be met by a framework; both must be hand-coded against the raw API

    These frameworks are distinguished by identity and tradeoff rather than syntax. The graph-oriented family makes the control flow an explicit state machine of nodes and conditional edges and persists checkpoints, which is what buys resumability after a crash. The type-safe family centers on validated structured output with dependency injection, retrying when the response does not satisfy the declared schema. A model-driven lightweight loop is the opposite tradeoff: the model plans, so the control flow is not written down and there is no graph to resume.

    Source: CCDV-F Exam Guide — Agent Patterns and Frameworks: framework identities and tradeoffsReport a problem with this question

  22. 22. An agent currently does everything through one broad shell tool. Product wants a confirmation dialog before any customer-facing email is sent, and an audit log of every send. What is the right change to the tool surface?

    • A.Wrap the shell tool so it returns is_error whenever the command mentions email
    • B.Promote sending email to a dedicated typed tool, giving the harness a specific hook it can gate, audit and renderAnswer
    • C.Remove the shell tool entirely so the agent cannot take any unreviewed action
    • D.Keep the shell tool and add a system-prompt instruction to always ask before sending email

    A broad shell tool gives breadth but hands the harness only an opaque command string — the same shape for every action — so it cannot reliably gate, audit, render or parallelize any particular one. Promoting an action to a dedicated tool with typed arguments gives the harness an action-specific hook. Reversibility is the criterion for which actions deserve that treatment: sending a customer email is hard to undo, so it is a natural candidate, whereas string-matching a shell command for the word email is exactly the brittle check the promotion is meant to replace.

    Source: Anthropic docs — Agent design: designing your tool surfaceReport 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 →