FEFreeExamDumps.in

CCA-F Practice Questions — Page 7

Scenario: Agent Architecture and Orchestration

An engineer builds an agent loop that calls Claude with tools. To decide when the task is finished, the loop scans the assistant's text for the phrase "task complete" and also stops after a fixed `max_iterations=5`. In production the agent sometimes halts mid-task and other times keeps looping after it is actually done.

What is the correct completion signal for the agent loop?

  • A.Keep the text scan but raise `max_iterations` to 15 so the agent has more room to finish.
  • B.Continue the loop while `stop_reason == "tool_use"` and stop when `stop_reason == "end_turn"`.
  • C.Stop as soon as the assistant returns any text content block alongside tool calls.
  • D.Ask the model at each step to self-report a boolean `is_done` field and stop when it is true.

Scenario: Agent Architecture and Orchestration

A coordinator delegates a document-summarization task to a subagent with the prompt: `Task: "Summarize the document."` The subagent replies that it has no document to summarize, even though the coordinator just received the document text from a previous tool call.

What is the root cause and the correct fix?

  • A.Subagents inherit the coordinator's full history automatically; the coordinator must be losing the document, so add a retry.
  • B.Subagents have isolated context and do not inherit the coordinator's history; the full document text must be passed explicitly in the subagent prompt.
  • C.The subagent needs the `Read` tool added to its `allowed_tools` so it can fetch the document itself.
  • D.The coordinator should store the document in a global variable that all subagents read on startup.

Scenario: Agent Architecture and Orchestration

A research coordinator must investigate three unrelated subtopics. It currently spawns one subagent, waits for the result, then spawns the next, tripling wall-clock latency. The three subtasks share no data and can run independently.

How should the coordinator dispatch the work?

  • A.Issue three `Task` calls in a single coordinator turn so the subagents run in parallel.
  • B.Merge the three subtopics into one large Task so a single subagent handles everything sequentially.
  • C.Keep the sequential pattern but reduce each subagent's `max_tokens` to speed up responses.
  • D.Spawn one subagent and have it recursively spawn the other two to share its context.

Scenario: Agent Architecture and Orchestration

A customer-support agent must never issue a refund above $500 without human approval. The team added the instruction "Never refund more than $500; escalate larger refunds" to the system prompt, but audits still find occasional $700 auto-refunds.

What is the most reliable way to enforce this rule?

  • A.Rephrase the system prompt more forcefully and add a few-shot example of refusing a large refund.
  • B.Lower the model temperature so it follows the instruction more deterministically.
  • C.Add a `PreToolUse` hook that intercepts `process_refund` and redirects any amount over $500 to escalation.
  • D.Move the rule into CLAUDE.md so it is loaded on every turn.

Scenario: Agent Architecture and Orchestration

Several MCP tools return dates in different formats: `lookup_order` returns a Unix timestamp, `get_shipment` returns "Mar 5, 2025", and `get_invoice` returns ISO 8601. The agent frequently miscompares dates across these tools.

Which mechanism best normalizes the data before the model sees it?

  • A.A `PostToolUse` hook that converts every tool result's date fields into a single canonical format (ISO 8601).
  • B.A system-prompt instruction telling the model to mentally convert all dates to ISO 8601 before comparing.
  • C.A `tool_choice` setting that forces the model to call only one date-returning tool.
  • D.Ask each MCP server's vendor to change their output format.

Scenario: Agent Architecture and Orchestration

A coordinator's `allowed_tools` list is `["get_customer", "lookup_order"]`. When it tries to delegate analysis to a subagent, nothing happens and no subagent is spawned.

What is missing?

  • A.The subagent's `system_prompt` is empty, so it silently exits.
  • B.The coordinator's `allowed_tools` must include `"Task"` to spawn subagents.
  • C.The coordinator must set `tool_choice: "any"` to force delegation.
  • D.Subagents can only be spawned from a user message, not from a coordinator.

Scenario: Agent Architecture and Orchestration

You must add automated tests to an unfamiliar legacy codebase of unknown structure. You do not yet know how many modules lack coverage or what their dependencies are; each step's findings determine the next.

Which decomposition strategy fits best?

  • A.A fixed prompt-chaining pipeline with the same predefined steps for every module.
  • B.Dynamic adaptive decomposition: map the structure first, then generate prioritized subtasks based on what is discovered.
  • C.Spawn one subagent per file up front, before knowing which files exist.
  • D.A single prompt that asks Claude to write all tests for the whole repository at once.

Scenario: Agent Architecture and Orchestration

A code-review agent is asked to review a 14-file pull request in a single pass. It produces detailed comments on the first few files, shallow notes on the rest, and flags a pattern in one file that it approves in identical code in another.

How should the workflow be restructured?

  • A.Increase `max_tokens` so the single pass can cover all files thoroughly.
  • B.Run per-file passes for local issues, then a separate integration pass for cross-file concerns.
  • C.Switch to a model with a larger context window and keep the single pass.
  • D.Review only the three largest files, since they usually contain the important changes.

Scenario: Agent Architecture and Orchestration

An investigation session named `auth-bug` was paused two days ago. Many source files have since been refactored. You want to continue the work.

What is the safest way to proceed?

  • A.Run `claude --resume auth-bug` and trust the cached tool results from two days ago.
  • B.Start a new session seeded with a short summary of prior findings, because the old tool results are now stale.
  • C.Use `fork_session` from the old session so both branches keep the stale results.
  • D.Resume the session and immediately run `/compact` to refresh the file contents.

Scenario: Agent Architecture and Orchestration

You want to compare two implementation strategies—Redux vs Context API—each starting from the same completed codebase investigation, then diverging independently.

Which session feature is designed for this?

  • A.`--resume`, run twice against the same session name.
  • B.`fork_session`, which branches independent lines of work from a shared context point.
  • C.`/compact`, to split the context into two halves.
  • D.`/memory`, to store both approaches in CLAUDE.md.