🎓 Claude Architect KB CCAR-F · CCAR-P study guide

Foundations Mock Exam 2 — 60 Scenario Questions, Timed (Q589–Q648)

A full-length CCAR-F practice simulation, built like the official exam: 60 questions in 120 minutes, under 4 scenarios drawn from the bank of 6, 15 questions per scenario. This mock uses Customer Support Resolution Agent · Developer Productivity with Claude · Claude Code for Continuous Integration · Structured Data Extraction. Every question was written for this guide against a task statement of the official Claude Certified Architect – Foundations Exam Guide (v1.0, July 2026), and the domain counts follow its blueprint. 4 questions are multiple-response and say “Select TWO”; the rest say “Select ONE”. This is not an official Anthropic or Pearson VUE exam. It does not reproduce, reconstruct or recall any live exam item, and the guide’s sample questions are used only as a model of style. Other full mocks: Mock 1 · Mock 3 · Mock 4.

Time remaining: 02:00:00

Loading the timed runner…

Official domain Study it here Blueprint weight Questions here
Agentic Architecture & Orchestration (official Domain 1) Domain 1 lesson 27% 16
Tool Design & MCP Integration (official Domain 2) Domain 4 lesson 18% 11
Claude Code Configuration & Workflows (official Domain 3) Domain 2 lesson 20% 12
Prompt Engineering & Structured Output (official Domain 4) Domain 3 lesson 20% 12
Context Management & Reliability (official Domain 5) Domain 5 lesson 15% 9

How to read your result. The runner reports a practice score: raw questions correct out of 60, a per-domain breakdown, the elapsed time and the unanswered count. Unanswered questions count as incorrect. The live exam reports a scaled score (pass mark 720 on 100–1,000); this page does not convert a raw score into a scaled score, because no public conversion exists. A useful study heuristic: aim for 80% here, with no domain under 65%, on a mock you have not seen before. Untimed practice by domain lives in Practice Questions and Concept Drills.

Foundations mock exam 2 · 60 questions (Q589–Q648)

Scenario 1 · Customer Support Resolution Agent

D1 · Agentic Architecture

Q589. A passenger writes one message: they were charged twice for a seat upgrade, their checked suitcase arrived with a broken handle, and they want the name spelling corrected on a booking for next month. Logs show the agent resolves the duplicate charge thoroughly and then closes the chat, leaving the other two requests unanswered. Which design change addresses this pattern? (Select ONE.) A) Have the agent handle only the first issue in each chat and ask the passenger to open a new chat for each remaining request after that. B) Raise max_tokens for each response so the agent has enough output space to discuss all three requests in a single long answer. C) Split the message into distinct issues, investigate each with the shared customer context, and send one reply covering all of them. D) Route every message that mentions more than one booking to escalate_to_human, because multi-issue cases are too complex for automation.

Understand Foundations Mock Exam 2 · Q589 · the situation and each part of the question

The real situation behind this question

A Coastline Airways passenger has three problems after one trip and writes them all in one message. The agent handles the double upgrade charge well, apologizes, and ends the chat. The passenger then has to come back about the suitcase and the name spelling, and the chat counts as unresolved. The team sees this pattern in many transcripts and needs a design that handles every concern in a message, not just the first one.

Read the question in parts

Part 1 · resolves the duplicate charge thoroughly and then closes the chat

the agent can do the work; it fails to track that more than one issue was raised.

Part 2 · they want the name spelling corrected on a booking for next month

the third request involves a different booking and a different action, so it must be its own item.

What you are being asked to decide

One message holds three requests, but the agent fixes only the first. How do you make it handle all three? Tests decomposing multi-concern requests into items before investigating and synthesizing.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Decompositionsplitting the passenger's message into three separate issues the agent tracks one by one
Parallelizationlooking up the upgrade charge, the baggage claim and the future booking at the same time instead of one after another

Study: Harness controls — what makes an agent production-grade Decomposition Parallelization

Understand Foundations Mock Exam 2 · Q589's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The agent stops after the first issue because it never split the message. Decompose into distinct items, investigate each using the shared customer context, then synthesize one reply that covers every item.

Connect the design to the situation

A double upgrade charge, a broken suitcase and a name correction, all in one chat message.

Best answer: C. The failure is decomposition: the agent treats the message as one problem and stops after the first. Splitting it into separate items, investigating each with the shared customer context, and synthesizing one reply covers all three. Escalating every multi-issue message pushes routine work to humans and lowers first-contact resolution.

The decisive evidence in the stem

leaving the other two requests unanswered The agent had the ability to solve each request but never treated them as separate items, so the fix is decomposing the message before investigating.

Official objective tested: Task 1.4 · Implement multi-step workflows with enforcement and handoff patterns

What each choice would do here

A · Why this does not meet the full requirement

Have the agent handle only the first issue in each chat and ask the passenger to open a new chat for each remaining request after that.

Pushes work back to the passenger and lowers first-contact resolution for something the agent can already do.

The passenger must start two more chats and repeat their identity details each time. Two of three issues become separate contacts, so the airline's first-contact resolution falls even though the agent could solve each one.

B · Why this does not meet the full requirement

Raise max_tokens for each response so the agent has enough output space to discuss all three requests in a single long answer.

Output space was not the limit; the agent stopped because it never planned the other two issues.

The agent still writes about only the duplicate charge, because it never planned the other two. A bigger token limit only allows a longer answer about the same single issue.

C · Why this meets the requirement

Split the message into distinct issues, investigate each with the shared customer context, and send one reply covering all of them.

Turns one message into a checklist, investigates each item with the same customer context, and closes with one complete reply.

The agent lists three items, then calls lookup_order for the upgrade charge, the baggage claim and next month's booking, reusing the customer ID from one get_customer call. It refunds the duplicate charge, opens a baggage repair claim, corrects the name, and summarizes all three in one reply.

D · Why this does not meet the full requirement

Route every message that mentions more than one booking to escalate_to_human, because multi-issue cases are too complex for automation.

Escalates routine work just because there is more of it, so humans get cases the agent could resolve.

Human agents receive a stream of simple name corrections and refunds. Resolution rates drop and wait times rise, while the agent's real defect, failing to split the message, remains in the system.

Check your understanding · explain the design in your own words

One message holds three requests, but the agent fixes only the first. How do you make it handle all three?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Harness controls — what makes an agent production-grade

Study: Harness controls — what makes an agent production-grade Decomposition Parallelization

Return to Foundations Mock Exam 2 · Q589's situation and clause-by-clause explanation

D4 · Tools & MCP

Q590. Besides the four core tools, the agent has one generic tool, account_action(action, params), that updates contact details, cancels bookings and applies travel credit. Logs show frequent malformed calls, such as a credit amount sent inside a phone-number field and cancellations sent without a booking reference. Which change would most improve reliability? (Select ONE.) A) Add few-shot examples to the system prompt that show a correctly formatted params object for each of the three actions the generic tool supports. B) Switch the agent to a larger model, which is better at remembering which parameter names belong to each action of a generic tool. C) Split account_action into update_contact_details, cancel_booking and apply_travel_credit, each with its own required inputs and a description of when to use it. D) Validate params inside account_action and return 'Invalid request' whenever the fields do not match the chosen action, so the agent tries again.

Understand Foundations Mock Exam 2 · Q590 · the situation and each part of the question

The real situation behind this question

Coastline Airways added account_action quickly so the agent could handle small account changes. It takes an action name and a loose params object. In production, the agent sometimes mixes fields between actions or forgets a booking reference, and the backend rejects or misapplies the request. The team wants account changes to be reliable without slowing the agent down. Every malformed call costs a retry or a wrong change.

Read the question in parts

Part 1 · a credit amount sent inside a phone-number field

the model does not know which fields belong to which action, a sign of a missing contract.

Part 2 · cancellations sent without a booking reference

a required input is not enforced, which a dedicated schema with required fields would fix.

What you are being asked to decide

One catch-all tool keeps getting wrong arguments. How do you make the calls correct? Tests splitting a generic tool into purpose-specific tools with defined input contracts.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
input_schemathe JSON Schema on each tool that names its required fields, such as booking_ref for cancel_booking
Tool descriptionthe text telling the model when to use apply_travel_credit rather than cancel_booking

Study: Tool use — the Claude API mechanics input_schema Tool description

Understand Foundations Mock Exam 2 · Q590's answer · full reasoning and worked examples
Claude synthesized · the point, straight

A generic tool with free-form params has no per-action contract. Split it into purpose-specific tools with required inputs and clear descriptions; the schema then carries the rules the model kept guessing.

Connect the design to the situation

A travel-credit amount ends up inside a phone-number field.

Best answer: C. One generic tool with a free-form params object gives the model no contract for each action. Purpose-specific tools with defined input schemas tell the model exactly which fields each action needs and make selection clearer. Few-shot examples help formatting but leave the open-ended contract that invites these errors.

The decisive evidence in the stem

one generic tool, account_action(action, params) A single tool with a free-form params object has no per-action schema, so the model must guess the fields for each action.

Official objective tested: Task 2.1 · Design effective tool interfaces with clear descriptions and boundaries

What each choice would do here

A · Why this does not meet the full requirement

Add few-shot examples to the system prompt that show a correctly formatted params object for each of the three actions the generic tool supports.

Can improve formatting, but the model still fills an open object with no per-action contract.

The examples show the right shape for common cases, and errors drop a little. But a new variation, such as cancelling one leg of a return trip, still has no schema guiding it, and the model guesses again.

B · Why this does not meet the full requirement

Switch the agent to a larger model, which is better at remembering which parameter names belong to each action of a generic tool.

Treats an interface design problem as a model capability problem.

A larger model may make fewer mistakes but costs more on every chat. The interface still lets credit amounts land in contact fields, so the error class remains.

C · Why this meets the requirement

Split account_action into update_contact_details, cancel_booking and apply_travel_credit, each with its own required inputs and a description of when to use it.

Gives each action its own schema and description, so wrong fields cannot fit and missing references are caught as required.

cancel_booking now requires booking_ref and reason; apply_travel_credit requires customer_id and amount. The model sees three clear tools, and a call missing booking_ref fails schema validation before it reaches the backend.

D · Why this does not meet the full requirement

Validate params inside account_action and return 'Invalid request' whenever the fields do not match the chosen action, so the agent tries again.

Catches errors after the fact with a generic message that does not say which field was wrong.

The agent receives 'Invalid request' and retries with another guess. Without saying which field was wrong, retries waste calls, and the generic tool remains the root cause.

Check your understanding · explain the design in your own words

One catch-all tool keeps getting wrong arguments. How do you make the calls correct?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Tool use — the Claude API mechanics

Study: Tool use — the Claude API mechanics input_schema Tool description

Return to Foundations Mock Exam 2 · Q590's situation and clause-by-clause explanation

D1 · Agentic Architecture

Q591. A passenger returns the next day about a damaged suitcase. The agent resumes yesterday's session, whose lookup_order results showed the baggage claim 'under review', and repeats that status. Overnight, the baggage team approved a repair and finance applied a partial travel credit, but nobody knows which of yesterday's lookups changed. Which approach should the agent use for returning passengers? (Select ONE.) A) Start a new session seeded with a structured case summary, and let the agent call the tools again for current data. B) Fork yesterday's session with fork_session so the agent keeps all of the earlier context but works in an independent new branch. C) Resume yesterday's session and tell the agent that the repair was approved, so it updates only that single status. D) Resume yesterday's session as before and add a system note saying that some earlier tool results may be out of date by now.

Understand Foundations Mock Exam 2 · Q591 · the situation and each part of the question

The real situation behind this question

A Coastline Airways passenger chatted yesterday about a suitcase damaged on a flight and was told the claim was under review. Today they come back. The agent resumes the old session and repeats the old status, but the baggage team has already approved a repair and finance has applied a credit. The passenger is confused. The team must decide how the agent should restart work on a case when backend systems may have changed overnight.

Read the question in parts

Part 1 · The agent resumes yesterday's session

the old tool results come back into context and look as trustworthy as new ones.

Part 2 · the baggage team approved a repair and finance applied a partial travel credit

more than one fact changed, and in different systems, so a single correction is not enough.

What you are being asked to decide

Yesterday's session holds old claim data. Should the agent continue it or start fresh? Tests choosing a fresh session with an injected summary over resuming with stale tool results.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Checkpointthe structured summary of yesterday's case that the new session starts from
Context windoweverything the model sees in a request, including yesterday's tool results if the session is resumed

Study: Named sessions: resume, continue, fork, or start fresh Checkpoint Context window

Understand Foundations Mock Exam 2 · Q591's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Old tool results come back with a resumed session. When you cannot say exactly what changed, resuming is unreliable. Start fresh with a structured case summary and let the agent query current data.

Connect the design to the situation

A repair was approved and a credit applied overnight, but the resumed session still says 'under review'.

Best answer: A. When prior tool results are stale and you cannot list which ones changed, a fresh session seeded with a structured summary is more reliable than resuming with old data. Telling a resumed session about one change works only when you know exactly what changed; here the credit also changed and nobody knows what else did.

The decisive evidence in the stem

nobody knows which of yesterday's lookups changed Targeted updates to a resumed session need a known list of changes; without one, the stale results must be dropped and the agent must re-query.

Official objective tested: Task 1.7 · Manage session state, resumption, and forking

What each choice would do here

A · Why this meets the requirement

Start a new session seeded with a structured case summary, and let the agent call the tools again for current data.

Keeps the durable facts and promises, drops the stale data, and forces fresh lookups.

The new session begins with 'Customer C-77102, booking R4M8TX, suitcase damaged, claim filed, partial credit discussed'. The agent calls lookup_order, sees the approved repair and the credit, and gives the passenger the current picture.

B · Why this does not meet the full requirement

Fork yesterday's session with fork_session so the agent keeps all of the earlier context but works in an independent new branch.

Copies the same stale tool results into the branch; forking is for exploring alternatives, not refreshing data.

The fork contains exactly the same old lookup results. It is designed for trying two approaches from one baseline; it does nothing to refresh data that changed in the backend.

C · Why this does not meet the full requirement

Resume yesterday's session and tell the agent that the repair was approved, so it updates only that single status.

Fixes the one change someone noticed but misses the credit and anything else that changed overnight.

The agent now reports the repair correctly but still quotes the old balance, because nobody mentioned the credit. Targeted updates work only when the full list of changes is known.

D · Why this does not meet the full requirement

Resume yesterday's session as before and add a system note saying that some earlier tool results may be out of date by now.

Leaves stale results in context with a vague warning, so the agent may still trust them.

The warning is vague, so Claude still sees 'under review' as the latest lookup and may repeat it or guess. Whether it re-queries depends on the model's judgment rather than on the design.

Check your understanding · explain the design in your own words

Yesterday's session holds old claim data. Should the agent continue it or start fresh?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Named sessions: resume, continue, fork, or start fresh

Study: Named sessions: resume, continue, fork, or start fresh Checkpoint Context window

Return to Foundations Mock Exam 2 · Q591's situation and clause-by-clause explanation

D1 · Agentic Architecture

Q592. Human agents complain that escalated chats arrive as one line such as 'Passenger needs help with a refund', so they spend six minutes re-asking questions the agent already answered. Their case system cannot display chat transcripts, and privacy policy forbids copying transcripts into cases. What should the escalate_to_human call carry so humans can act at once? (Select ONE.) A) A link to the full chat transcript stored in the agent's session log, so the human can scroll through the conversation and find the details. B) A structured handoff with customer ID, booking references, the root cause found, amounts involved, steps already taken, and a recommended next action for the human. C) The passenger's sentiment score and the agent's confidence rating, so the human queue can prioritize the angriest and least certain cases first. D) A warm, empathetic paragraph written by the agent that retells the conversation in the passenger's own words and apologizes for the trouble.

Understand Foundations Mock Exam 2 · Q592 · the situation and each part of the question

The real situation behind this question

When Coastline Airways' agent escalates, a human support agent picks up the case in a separate system. Today the case says only that the passenger needs help with a refund. The human has to ask for the booking reference, the problem and what was already tried, and the passenger repeats everything. Transcripts are not available in that system for privacy reasons. The team must decide what the escalation itself should carry.

Read the question in parts

Part 1 · re-asking questions the agent already answered

the facts exist in the agent's context but are lost at the handoff boundary.

Part 2 · privacy policy forbids copying transcripts into cases

the answer cannot be 'give them the transcript'; the agent must summarize into defined fields.

What you are being asked to decide

Humans get escalations with almost no detail and cannot read the chat. What should the escalation contain? Tests compiling a structured handoff summary for humans who lack the transcript.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Handoffthe package of facts the agent passes to a human when it escalates mid-process
Escalationthe agent's call to escalate_to_human when a case must leave the automated path

Study: Escalation design (scenario 1 territory) Handoff Escalation

Understand Foundations Mock Exam 2 · Q592's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The human cannot see the chat, so the escalation is the only channel. It must carry structured facts: IDs, root cause, amounts, actions taken and a recommendation. Define those fields in the escalate_to_human input schema.

Connect the design to the situation

A refund escalation that reaches the human queue as one vague sentence.

Best answer: B. The human cannot see the transcript, so the handoff must carry the facts and conclusions in a structured, scannable form: who, which bookings, what went wrong, what was done, and what to do next. A transcript link fails because the case system cannot display transcripts and copying them is forbidden.

The decisive evidence in the stem

cannot display chat transcripts The human sees only what the escalation call carries, so the agent must compile the case facts, root cause and recommendation into the handoff itself.

Official objective tested: Task 1.4 · Implement multi-step workflows with enforcement and handoff patterns

What each choice would do here

A · Why this does not meet the full requirement

A link to the full chat transcript stored in the agent's session log, so the human can scroll through the conversation and find the details.

Depends on transcript access that the case system does not have and that policy does not allow.

The human clicks the link and gets an access error, because the case system cannot render session logs. Even if it worked, reading forty turns is slower than reading six fields, and it breaks the stated privacy policy.

B · Why this meets the requirement

A structured handoff with customer ID, booking references, the root cause found, amounts involved, steps already taken, and a recommended next action for the human.

Gives the human everything needed to act without the transcript, in fields they can scan in seconds.

The case opens with customer ID C-48211, booking K7Q2PF, root cause 'flight cancelled; passenger bought a hotel night', amount $640, steps 'cancellation confirmed, receipt received', and recommendation 'approve reimbursement, over $400 limit'. The human acts in under a minute.

C · Why this does not meet the full requirement

The passenger's sentiment score and the agent's confidence rating, so the human queue can prioritize the angriest and least certain cases first.

Helps ordering the queue, but the human still has to re-ask every question once the case opens.

The queue would be sorted differently, but each case still opens with no booking reference, root cause or recommendation. Sentiment and self-reported confidence also do not tell the human what to do.

D · Why this does not meet the full requirement

A warm, empathetic paragraph written by the agent that retells the conversation in the passenger's own words and apologizes for the trouble.

Is prose built for the passenger, not for an agent who needs IDs, amounts and a recommended action.

The paragraph is pleasant but buries the booking reference and amount in prose. The human must still extract the facts, and anything the agent did not mention is missing, so re-asking continues.

Walk through complete payloads or code · every step explained

Illustrative examples, not recorded live calls. Check each block's direction and endpoint: API requests, API responses, MCP messages, and configuration files are different contracts.

escalate_to_human input (illustrative values)

JSON
{"customer_id": "C-48211", "booking_refs": ["K7Q2PF"], "root_cause": "Flight cancelled; passenger paid for a hotel night", "amount_usd": 640.00, "steps_taken": ["cancellation confirmed", "hotel receipt received"], "recommended_action": "Approve reimbursement; amount exceeds $400 refund limit"}

Defining these fields in the tool's input schema makes the agent fill them every time it escalates.

Which omitted settings use defaults or leave features unconfigured?

Check your understanding · explain the design in your own words

Humans get escalations with almost no detail and cannot read the chat. What should the escalation contain?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Escalation design (scenario 1 territory)

Study: Escalation design (scenario 1 territory) Handoff Escalation

Return to Foundations Mock Exam 2 · Q592's situation and clause-by-clause explanation

D4 · Tools & MCP

Q593. lookup_order searches two backends: the live booking database and an archive for bookings older than two years. When the archive is unreachable, the tool quietly returns only live bookings. Passengers asking about unused travel credit from 2022 trips are told 'that booking isn't on file' and give up. How should lookup_order report results in this situation? (Select ONE.) A) Retry the archive inside the tool until it finally responds, however long that takes, before returning any results to the agent at all. B) Keep the response unchanged and tell the agent in the system prompt that older bookings may sometimes be missing from lookup_order results. C) Return the live bookings plus a structured note that the archive query failed and is retryable, so older bookings are not denied. D) Return isError for the whole call whenever the archive is unreachable and discard the live bookings, so the agent never works from incomplete data.

Understand Foundations Mock Exam 2 · Q593 · the situation and each part of the question

The real situation behind this question

Coastline Airways stores bookings older than two years in a separate archive. When that archive was unreachable for an afternoon, lookup_order returned only recent bookings and said nothing about the failure. Passengers asking about unused credit from older trips were told their bookings did not exist, and many gave up on credit they were owed. The team must change how the tool reports a partial failure.

Read the question in parts

Part 1 · When the archive is unreachable

this is an access failure, which needs a retry decision, not a 'no results' answer.

Part 2 · are told 'that booking isn't on file' and give up

the silent failure caused real customer harm by turning 'not checked' into a false fact.

What you are being asked to decide

When the archive is down, old bookings look like they never existed. How should the tool report that? Tests distinguishing access failures from valid empty results, while keeping partial results.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
tool_resultthe block that carries the live bookings and the note about the failed archive query back to the agent
Graceful degradationanswering with what is available and saying clearly what could not be checked

Study: The MCP error contract — isError and structured error metadata tool_result Graceful degradation

Understand Foundations Mock Exam 2 · Q593's answer · full reasoning and worked examples
Claude synthesized · the point, straight

A silent partial failure looks like a valid answer. Return the results that succeeded plus structured, retryable error details for the part that failed, so the agent never reports 'not checked' as 'not found'.

Connect the design to the situation

A 2022 booking with unused credit 'isn't on file' only because the archive was unreachable.

Best answer: C. The tool turned an access failure into what looks like a valid answer, so the agent stated a false fact. Returning what succeeded plus structured information about what failed lets the agent use the live bookings, retry or explain the archive delay. Failing the whole call throws away good data the agent needs for current bookings.

The decisive evidence in the stem

the tool quietly returns only live bookings A failed archive query looks the same as an archive with no matching bookings, so the agent cannot tell 'not found' from 'not checked'.

Official objective tested: Task 2.2 · Implement structured error responses for MCP tools

What each choice would do here

A · Why this does not meet the full requirement

Retry the archive inside the tool until it finally responds, however long that takes, before returning any results to the agent at all.

Blocks the chat for an unknown time instead of letting the agent decide what to do.

The chat freezes while the tool waits on a dead archive, and the passenger leaves. The agent never gets the chance to explain the delay or offer a follow-up.

B · Why this does not meet the full requirement

Keep the response unchanged and tell the agent in the system prompt that older bookings may sometimes be missing from lookup_order results.

A vague warning still leaves the agent unable to tell 'not found' from 'not checked'.

The agent now hedges on every lookup, even when the archive worked, and still cannot tell when a specific old booking is truly missing. Passengers get vague answers instead of false ones.

C · Why this meets the requirement

Return the live bookings plus a structured note that the archive query failed and is retryable, so older bookings are not denied.

Keeps the good data and tells the agent which part failed and that a retry may work.

The result lists live bookings and adds {archive: {status: 'unavailable', errorCategory: 'transient', isRetryable: true}}. The agent retries once, then tells the passenger 'our archive is slow right now; I'll follow up on your 2022 booking', instead of denying it exists.

D · Why this does not meet the full requirement

Return isError for the whole call whenever the archive is unreachable and discard the live bookings, so the agent never works from incomplete data.

Discards valid live bookings and blocks current-trip questions during an archive outage.

During every archive outage, even passengers asking about next week's flight get an error. The agent cannot help anyone, though the live database was working the whole time.

Check your understanding · explain the design in your own words

When the archive is down, old bookings look like they never existed. How should the tool report that?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: The MCP error contract — isError and structured error metadata

Study: The MCP error contract — isError and structured error metadata tool_result Graceful degradation

Return to Foundations Mock Exam 2 · Q593's situation and clause-by-clause explanation

D4 · Tools & MCP

Q594. To save effort, the platform team connected the agent to the airline's general MCP server, giving it 19 tools, including seat inventory adjustment, promo-code creation and crew schedule lookups. Since then, tool-selection errors have tripled, and the agent once created a 30% promo code instead of a travel credit. What change should you make? (Select ONE.) A) Rewrite all 19 tool descriptions with clear boundaries and examples, so the agent can choose correctly among the whole set of tools. B) Move to a larger model with a longer context window, so the agent can reason across all 19 tool definitions without confusion. C) Add a classifier in front of the agent that predicts the needed tool for each message and forces that tool with tool_choice. D) Expose only the tools the support role needs, such as the four core tools plus a travel-credit tool.

Understand Foundations Mock Exam 2 · Q594 · the situation and each part of the question

The real situation behind this question

Coastline Airways' platform team reused a general MCP server for the support agent, so the agent suddenly saw 19 tools meant for several teams. Selection errors rose, and once the agent issued a marketing promo code when it should have applied a travel credit. The support lead wants the errors gone and wants to be sure the agent cannot touch inventory, marketing or crew functions.

Read the question in parts

Part 1 · tool-selection errors have tripled

the change in the tool set is the clear cause of the new errors.

Part 2 · created a 30% promo code instead of a travel credit

a tool outside the agent's role was misused, which tool scoping prevents.

What you are being asked to decide

The agent got 19 tools, most of them for other teams, and now picks wrong. What do you change? Tests scoping an agent's tools to its role to restore selection reliability.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Least-privilege toolinggiving the support agent only the tools a support case needs, nothing for inventory, marketing or crew
Capability bloatthe growth from 4 to 19 tools that made each tool choice harder

Study: Reuse implementation without exposing unrestricted tools Least-privilege tooling Capability bloat

Understand Foundations Mock Exam 2 · Q594's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Selection broke when 19 tools appeared, and some of them do not belong to the role. Scope the agent to its support tools; this lowers decision complexity and removes the chance of misuse.

Connect the design to the situation

The support agent creates a promo code instead of applying travel credit.

Best answer: D. Too many tools degrade selection by increasing decision complexity, and tools outside the agent's role invite misuse such as promo codes instead of credits. Scoping the agent to its role's tools removes both problems. Better descriptions help choose among relevant tools, but the promo and crew tools should not be available to a support agent at all.

The decisive evidence in the stem

giving it 19 tools The error rate rose when irrelevant tools were added, so reducing the set to the role's needs addresses the cause directly.

Official objective tested: Task 2.3 · Distribute tools appropriately across agents and configure tool choice

What each choice would do here

A · Why this does not meet the full requirement

Rewrite all 19 tool descriptions with clear boundaries and examples, so the agent can choose correctly among the whole set of tools.

Clearer descriptions still leave the agent able to create promo codes or change seat inventory.

Descriptions improve, and some errors drop, but the agent still chooses among 19 options. The promo tool remains one plausible choice away, so a confused turn can still create a discount.

B · Why this does not meet the full requirement

Move to a larger model with a longer context window, so the agent can reason across all 19 tool definitions without confusion.

Treats an access design problem as a model capacity problem.

A larger model may choose slightly better but costs more for every chat. The support agent still holds inventory and marketing powers it never needs.

C · Why this does not meet the full requirement

Add a classifier in front of the agent that predicts the needed tool for each message and forces that tool with tool_choice.

Adds a component to choose among tools that should not be there in the first place.

The classifier must learn which of 19 tools fits each message, and forcing a tool removes the agent's own judgment. The irrelevant tools are still exposed whenever the classifier errs.

D · Why this meets the requirement

Expose only the tools the support role needs, such as the four core tools plus a travel-credit tool.

Cuts decision complexity and removes tools the role should never use.

The support agent sees get_customer, lookup_order, process_refund, escalate_to_human and apply_travel_credit. Selection gets easier, and promo or inventory actions are no longer possible from support chats. Other teams keep their tools on their own agents.

Check your understanding · explain the design in your own words

The agent got 19 tools, most of them for other teams, and now picks wrong. What do you change?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Reuse implementation without exposing unrestricted tools

Study: Reuse implementation without exposing unrestricted tools Least-privilege tooling Capability bloat

Return to Foundations Mock Exam 2 · Q594's situation and clause-by-clause explanation

D5 · Context & Reliability

Q595. A passenger types only an email address. get_customer returns two accounts that share it, held by a parent and an adult child, and both have upcoming bookings. The agent chose the account with the more expensive booking and cancelled a trip that the other family member still planned to take. How should the agent handle lookups that return more than one account? (Select ONE.) A) Escalate to a human every time get_customer returns more than one account, because identity questions are too risky to automate. B) Pick the account whose upcoming bookings best match the problem the passenger describes, then read the trip details back for confirmation. C) Look up both accounts' bookings in parallel and act on whichever account contains the flight the passenger mentions in the chat. D) Ask the passenger for an additional identifier, such as a booking reference or date of birth, before continuing.

Understand Foundations Mock Exam 2 · Q595 · the situation and each part of the question

The real situation behind this question

At Coastline Airways, family members often share one email address across separate loyalty accounts. When get_customer returns more than one account, the agent currently picks one by a rule of thumb. Last week that guess cancelled a trip for the wrong family member, who then had to rebook at a much higher fare. The team needs the agent to handle shared identifiers safely without sending every case to humans.

Read the question in parts

Part 1 · chose the account with the more expensive booking

the current behaviour is a heuristic selection, which is the anti-pattern for multiple matches.

Part 2 · cancelled a trip that the other family member still planned to take

the cost of a wrong guess is a real action taken on the wrong person's account.

What you are being asked to decide

Two accounts share the email address. Should the agent guess, escalate, or ask? Tests asking for additional identifiers instead of choosing among multiple matches by heuristic.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Escalationsending the case to a human, which is not needed when one question can resolve the ambiguity
Trust boundarythe point where the agent must be sure who the passenger is before touching account data

Study: Escalation and ambiguity: when to hand off, when to ask Escalation Trust boundary

Understand Foundations Mock Exam 2 · Q595's answer · full reasoning and worked examples
Claude synthesized · the point, straight

More than one account matches, so any pick is a guess, and a guess already cancelled the wrong trip. Ask for one more identifier, then continue on the single matching account.

Connect the design to the situation

A parent and adult child share an email, and the wrong person's trip is cancelled.

Best answer: D. When a lookup returns multiple matches, the agent should ask for more identifiers rather than pick one by heuristic. One extra question resolves the ambiguity safely and keeps the case automated. Matching by trip description is still a guess, and guessing already cancelled the wrong trip.

The decisive evidence in the stem

returns two accounts that share it The identifier given does not point to one person, so any choice without more information is a guess about whose account it is.

Official objective tested: Task 5.2 · Design effective escalation and ambiguity resolution patterns

What each choice would do here

A · Why this does not meet the full requirement

Escalate to a human every time get_customer returns more than one account, because identity questions are too risky to automate.

Sends a simple clarification to humans and lowers resolution for a solvable case.

Every shared-email passenger now waits for a human, though one question would have solved it. Resolution drops, and humans spend time on simple identity checks.

B · Why this does not meet the full requirement

Pick the account whose upcoming bookings best match the problem the passenger describes, then read the trip details back for confirmation.

Still a heuristic guess, so a similar trip on the other account leads to the wrong action.

Both family members booked flights to the same city for the same holiday. The agent picks one by description and reads back details the other person might also recognize, so the wrong-account action can repeat.

C · Why this does not meet the full requirement

Look up both accounts' bookings in parallel and act on whichever account contains the flight the passenger mentions in the chat.

Reads another person's booking data while guessing, which is unsafe and still a heuristic.

The agent reads two people's booking histories in its reasoning and still decides by guess when both accounts hold similar trips. It acts on data the passenger may not be entitled to see.

D · Why this meets the requirement

Ask the passenger for an additional identifier, such as a booking reference or date of birth, before continuing.

Resolves the ambiguity with the passenger's own information before any account action.

The agent says 'Two accounts use this email; could you share your booking reference or date of birth?' The passenger gives the booking reference, one account matches, and the agent continues safely without involving a human.

Check your understanding · explain the design in your own words

Two accounts share the email address. Should the agent guess, escalate, or ask?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Escalation and ambiguity: when to hand off, when to ask

Study: Escalation and ambiguity: when to hand off, when to ask Escalation Trust boundary

Return to Foundations Mock Exam 2 · Q595's situation and clause-by-clause explanation

D1 · Agentic Architecture

Q596. Before moving to the Agent SDK, your team tested a prototype that runs its own loop on the Messages API. Transcripts show that when Claude returns a short sentence such as 'Let me pull up that booking' together with a lookup_order request, the prototype sends the sentence to the customer and ends the turn, so the lookup never runs. Which change fixes the loop's control flow? (Select ONE.) A) Keep calling the model until a fixed limit of eight calls is reached, then send the most recent text block to the customer as the reply. B) Loop on stop_reason: while it is "tool_use", run the requested tools and append their results; stop only when it is "end_turn". C) Tell Claude in the system prompt never to write text in a response that requests a tool, so any text block reliably marks the final answer. D) Scan each response for phrases such as 'let me check' or 'one moment', keep looping when one appears, and end the turn when none is found.

Understand Foundations Mock Exam 2 · Q596 · the situation and each part of the question

The real situation behind this question

Coastline Airways' support team built a quick prototype before adopting the Agent SDK. A passenger asks whether the refund for a cancelled flight has gone through. Claude answers with a friendly preamble and, in the same response, a request to call lookup_order. The prototype treats any text as the final answer, so the passenger reads 'Let me pull up that booking' and then nothing happens. The team must fix how the loop decides to continue or stop before trusting it with refunds.

Read the question in parts

Part 1 · runs its own loop on the Messages API

the team's code, not the SDK, decides when to continue, so the bug lives in harness control flow.

Part 2 · the prototype sends the sentence to the customer and ends the turn

the loop is using the presence of text as its completion signal, which is the anti-pattern.

What you are being asked to decide

The prototype stops as soon as Claude writes any words, even when Claude also asked for a tool. How should the loop decide when to stop? Tests driving the agentic loop on stop_reason instead of on text content.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Stop reasonthe field on each API response that says why Claude stopped: to request a tool ("tool_use") or because it finished ("end_turn")
Agent loopthe harness code that calls the model, runs requested tools, appends results and calls the model again

Study: The agentic loop — the exam's core object Agent loop Stop reason tool_result

Understand Foundations Mock Exam 2 · Q596's answer · full reasoning and worked examples
Claude synthesized · the point, straight

A response can hold text and a tool request at the same time. So text cannot be the completion signal; stop_reason is. Continue on "tool_use" with appended tool results, and stop on "end_turn".

Connect the design to the situation

Claude says 'Let me pull up that booking' and requests lookup_order, but the customer only receives the sentence.

Best answer: B. The loop must be driven by the structured stop_reason field: "tool_use" means run the tools and call the model again with the results, and "end_turn" means the answer is finished. The prompt rule tries to make a text check safe, but text can legitimately accompany a tool request, so treating text as completion stays fragile.

The decisive evidence in the stem

together with a lookup_order request The response contained both text and a tool request, so the presence of text cannot mean the turn is done; only stop_reason tells the harness whether a tool must run next.

Official objective tested: Task 1.1 · Design and implement agentic loops for autonomous task execution

What each choice would do here

A · Why this does not meet the full requirement

Keep calling the model until a fixed limit of eight calls is reached, then send the most recent text block to the customer as the reply.

Makes an iteration cap the main stop condition, which cuts off long cases and wastes calls on short ones.

A simple question would trigger extra paid calls after Claude finished, and a complex rebooking needing nine tool calls would be cut off. A cap is a safety net, not the way to know the task is complete.

B · Why this meets the requirement

Loop on stop_reason: while it is "tool_use", run the requested tools and append their results; stop only when it is "end_turn".

Uses the structured signal the API provides, so tool requests always run and the loop ends only when Claude has finished.

The harness checks stop_reason after every call. On "tool_use" it executes lookup_order, appends a user message with the tool_result, and calls Claude again. Claude then answers with the real refund status and stop_reason "end_turn", and only then does the reply go out.

C · Why this does not meet the full requirement

Tell Claude in the system prompt never to write text in a response that requests a tool, so any text block reliably marks the final answer.

Asks the model to make a fragile text check safe; a prompt rule has a non-zero failure rate and the real signal is ignored.

Claude would usually comply, but not always, and the preamble is useful to passengers anyway. The day Claude writes one sentence before a refund call, the loop again ends early and the refund silently never happens.

D · Why this does not meet the full requirement

Scan each response for phrases such as 'let me check' or 'one moment', keep looping when one appears, and end the turn when none is found.

Parses natural language to decide termination, which breaks whenever Claude phrases the preamble differently.

The scan would catch today's phrases and miss tomorrow's, such as 'Checking now'. It also misfires when a final answer happens to say 'let me check with the airport team', creating loops that never end.

Walk through complete payloads or code · every step explained

Illustrative examples, not recorded live calls. Check each block's direction and endpoint: API requests, API responses, MCP messages, and configuration files are different contracts.

Loop control on stop_reason (illustrative)

PYTHON
while True:
    resp = client.messages.create(model=MODEL, system=SYSTEM, tools=TOOLS, messages=messages, max_tokens=1024)
    messages.append({'role': 'assistant', 'content': resp.content})
    if resp.stop_reason != 'tool_use':
        break
    results = [run_tool(b) for b in resp.content if b.type == 'tool_use']
    messages.append({'role': 'user', 'content': results})

The text block and the tool_use block arrive in the same response; the loop looks only at stop_reason to decide what to do next.

Not supplied in this example · settings and defaults

context_management — not supplied here. No server compaction strategy is enabled by this body. Host/manual compaction is separate.

output_config — not supplied here. No output_config schema or effort override is supplied. A prompt asking for JSON does not provide schema enforcement.

tool_choice — not supplied here. With tools supplied, the default is auto: the model chooses whether to request a tool. Without tools, no supplied tool can be selected.

stop_sequences — not supplied here. No custom stop strings are configured. Generation can still stop for end_turn, tool_use, max_tokens, or another documented reason.

stream — not supplied here. For a direct non-streaming create/parse call, the result is one message rather than an event stream. A stream helper configures this separately.

thinking — not supplied here. No explicit thinking override is shown. Behavior depends on the selected model; omission does not universally mean thinking is off.

cache_control — not supplied here. No top-level automatic cache marker is supplied. Check nested system/tool/content blocks for separate cache_control markers.

metadata — not supplied here. No application user reference is supplied through metadata. Authentication still comes from the request credentials.

betas — not explicitly supplied. No beta list appears in these calls. SDK/client configuration can add headers; inspect those before assuming no beta header is sent.

Which omitted settings use defaults or leave features unconfigured?

Check your understanding · explain the design in your own words

The prototype stops as soon as Claude writes any words, even when Claude also asked for a tool. How should the loop decide when to stop?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: The agentic loop — the exam's core object

Study: The agentic loop — the exam's core object Agent loop Stop reason tool_result

Return to Foundations Mock Exam 2 · Q596's situation and clause-by-clause explanation

D5 · Context & Reliability

Q597. Coastline Airways is rewriting the agent's escalation criteria because first-contact resolution is stuck at 71%. The agent currently escalates angry passengers whose cases are simple, and handles some unusual requests on its own. Which TWO conditions should trigger escalation to a human? (Select TWO.) A) Policy is silent on the request, such as compensation for a pet carrier damaged in the cabin when policy covers only checked baggage. B) The agent reports a confidence below 0.6 in its proposed resolution, using a score it generates alongside its reply. C) The passenger explicitly asks to speak with a human, even if the issue looks simple for the agent to resolve right away. D) A sentiment classifier scores the passenger's latest message as very negative, which suggests the passenger is frustrated with the agent.

Understand Foundations Mock Exam 2 · Q597 · the situation and each part of the question

The real situation behind this question

Coastline Airways' agent escalates too much and too little at the same time. It hands off angry passengers with easy cases and keeps unusual requests it should not decide alone. The team is writing new escalation criteria and needs to pick triggers that reflect what humans are really needed for, so resolution rises without the agent overstepping policy. Every wrong escalation costs time.

Read the question in parts

Part 1 · first-contact resolution is stuck at 71%

unneeded escalations are costing resolution, so triggers must be precise.

Part 2 · handles some unusual requests on its own

the agent also misses cases that need a human, such as requests outside policy.

What you are being asked to decide

Which two situations really need a human: the passenger asks for one, they are angry, policy does not cover the case, or the agent feels unsure? Tests choosing reliable escalation triggers over sentiment and self-reported confidence.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Escalationhanding the case to the human queue through escalate_to_human
Calibrationchecking a confidence score against real outcomes; the agent's self-reported score has not been checked

Study: Escalation and ambiguity: when to hand off, when to ask Escalation Calibration

Understand Foundations Mock Exam 2 · Q597's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Escalate when the passenger asks for a human or when policy does not cover the request. Do not use sentiment or uncalibrated self-reported confidence; they do not measure whether a human is needed.

Connect the design to the situation

An angry passenger with a simple double charge versus a request that policy never mentions.

Best answer: AC. An explicit request for a human should be honoured immediately, and a policy gap means the agent has no rule to apply, so a human must decide. Negative sentiment does not measure case complexity: an angry passenger with a simple duplicate charge is still a case the agent can resolve. Self-reported confidence is not calibrated against real outcomes.

The decisive evidence in the stem

escalates angry passengers whose cases are simple Emotion is driving escalation today, which shows sentiment is the wrong trigger and real triggers must be based on requests and policy.

Official objective tested: Task 5.2 · Design effective escalation and ambiguity resolution patterns

What each choice would do here

A · Why this does not meet the full requirement

Policy is silent on the request, such as compensation for a pet carrier damaged in the cabin when policy covers only checked baggage.

With no applicable policy, the agent has no rule to follow, so a human must decide.

A passenger asks for compensation because a pet carrier was crushed in the cabin. Policy covers checked baggage, not cabin items. The agent explains it will connect them with a person who can decide, and escalates with the details.

B · Why this does not meet the full requirement

The agent reports a confidence below 0.6 in its proposed resolution, using a score it generates alongside its reply.

A self-reported score without calibration is an unreliable proxy for case difficulty.

The model's self-reported 0.6 is not tied to measured accuracy, so it can be high on wrong answers and low on easy ones. Using it as a trigger adds noise rather than catching the cases that need humans.

C · Why this does not meet the full requirement

The passenger explicitly asks to speak with a human, even if the issue looks simple for the agent to resolve right away.

An explicit request for a human must be honoured at once.

A passenger types 'I want a person'. The agent confirms and calls escalate_to_human immediately with a structured handoff, instead of first trying to investigate. Ignoring such a request damages trust and violates a basic support norm.

D · Why this does not meet the full requirement

A sentiment classifier scores the passenger's latest message as very negative, which suggests the passenger is frustrated with the agent.

Sentiment measures emotion, not complexity, and it causes the over-escalation already seen.

An angry passenger charged twice for a seat upgrade would be escalated, even though the agent can refund the duplicate in two minutes. Escalations rise and resolution falls, the exact pattern the team wants to fix.

Check your understanding · explain the design in your own words

Which two situations really need a human: the passenger asks for one, they are angry, policy does not cover the case, or the agent feels unsure?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Escalation and ambiguity: when to hand off, when to ask

Study: Escalation and ambiguity: when to hand off, when to ask Escalation Calibration

Return to Foundations Mock Exam 2 · Q597's situation and clause-by-clause explanation

D1 · Agentic Architecture

Q598. The system prompt says refunds above $400 need supervisor approval, and few-shot examples show the agent escalating instead. A monthly audit still finds that about 2% of refunds over $400 went through process_refund directly, often after a passenger pushed hard. Finance requires this rule to hold every time. What should you implement? (Select ONE.) A) A PreToolUse hook on process_refund that blocks calls above $400 and redirects the case to escalate_to_human. B) A nightly job in which a second Claude instance reviews every refund issued that day and flags those above $400 for finance to reverse. C) A stronger system prompt that puts the $400 rule first, in capital letters, and adds more few-shot examples of passengers pushing for refunds. D) Remove process_refund from the agent entirely, so that every refund of any amount is handled by the human queue through escalate_to_human.

Understand Foundations Mock Exam 2 · Q598 · the situation and each part of the question

The real situation behind this question

Coastline Airways allows the agent to issue small refunds alone, but anything above $400 needs a supervisor. The rule is in the system prompt with examples, and it works most of the time. But when passengers argue hard, the agent occasionally gives in and refunds $500 or $600 directly. Finance has said this must never happen. The architect must choose a control that guarantees the threshold without losing the automation for small refunds.

Read the question in parts

Part 1 · often after a passenger pushed hard

the failures come from conversational pressure, which prompt instructions cannot fully resist.

Part 2 · few-shot examples show the agent escalating instead

the prompt-based approach is already done well, so more of it is not the missing piece.

What you are being asked to decide

The prompt already says 'no refunds over $400 without a supervisor', but the agent still does it sometimes. How do you make it impossible? Tests choosing a tool-call interception hook over prompt guidance for a guaranteed business rule.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Hookcode the Agent SDK runs before process_refund executes, which can allow or deny the call
Deterministicthe same input always gives the same result: a $520 refund is always blocked, never just usually

Study: Agent SDK hooks: block a call, clean up a result Hook Deterministic Guardrail

Understand Foundations Mock Exam 2 · Q598's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Finance needs the rule every time, and prompts are probabilistic. So enforce it in code at the moment of the call: a PreToolUse hook blocks refunds above $400 and redirects to escalation, while small refunds still flow.

Connect the design to the situation

A pushy passenger gets a $520 refund processed directly despite the $400 rule.

Best answer: A. A rule that must hold every time needs deterministic enforcement in code; a hook that intercepts the outgoing call blocks it before money moves and redirects to the human path. More prompt emphasis only lowers a failure rate that is already non-zero, and removing the tool sacrifices every small refund the agent handles correctly.

The decisive evidence in the stem

Finance requires this rule to hold every time A guarantee rules out any prompt-only approach, because prompts are followed probabilistically; only code that intercepts the call can guarantee the threshold.

Official objective tested: Task 1.5 · Apply Agent SDK hooks for tool call interception and data normalization

What each choice would do here

A · Why this meets the requirement

A PreToolUse hook on process_refund that blocks calls above $400 and redirects the case to escalate_to_human.

Code checks the amount on every call and blocks violations before any money moves, then routes to the right workflow.

The hook reads the amount in the process_refund input. At $520 it returns a deny decision with a reason, and the harness calls escalate_to_human with the booking and amount. Refunds of $400 or less pass through untouched, so automation is kept.

B · Why this does not meet the full requirement

A nightly job in which a second Claude instance reviews every refund issued that day and flags those above $400 for finance to reverse.

Detects violations after the money has moved, so finance must chase reversals instead of preventing them.

Finance gets a list each morning of refunds that already reached passengers' cards. Reversing them angers passengers and costs staff time; the review detects the problem but never prevents it.

C · Why this does not meet the full requirement

A stronger system prompt that puts the $400 rule first, in capital letters, and adds more few-shot examples of passengers pushing for refunds.

Still relies on the model to follow text, so pressure from passengers keeps producing occasional violations.

Capital letters and more examples might cut violations from 2% to 1%, but finance asked for zero. The next passenger who argues for twenty minutes can still get the refund processed, because nothing in code stops the call.

D · Why this does not meet the full requirement

Remove process_refund from the agent entirely, so that every refund of any amount is handled by the human queue through escalate_to_human.

Guarantees the rule but throws away automation for the many small refunds that are allowed.

Every $25 refund for an unused seat selection would now wait for a human. First-contact resolution would fall far below the 80% target, even though small refunds were never the problem.

Walk through complete payloads or code · every step explained

Illustrative examples, not recorded live calls. Check each block's direction and endpoint: API requests, API responses, MCP messages, and configuration files are different contracts.

PreToolUse hook for the refund threshold (illustrative)

PYTHON
async def refund_limit(input_data, tool_use_id, context):
    amount = input_data['tool_input'].get('amount', 0)
    if amount > 400:
        return {'hookSpecificOutput': {
            'hookEventName': 'PreToolUse',
            'permissionDecision': 'deny',
            'permissionDecisionReason': 'Refunds above $400 need a supervisor: call escalate_to_human with the booking and amount.'}}
    return {}

Registered for the process_refund tool, the hook runs before every call; the denial reason tells the model which path to take instead.

Which omitted settings use defaults or leave features unconfigured?

Check your understanding · explain the design in your own words

The prompt already says 'no refunds over $400 without a supervisor', but the agent still does it sometimes. How do you make it impossible?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Agent SDK hooks: block a call, clean up a result

Study: Agent SDK hooks: block a call, clean up a result Hook Deterministic Guardrail

Return to Foundations Mock Exam 2 · Q598's situation and clause-by-clause explanation

D4 · Tools & MCP

Q599. You add a get_refund_status tool with a clear, detailed description. Weeks later, logs show the agent still calls lookup_order when passengers ask 'Where is my refund?', and calls it even for questions about the fare refund rules. The system prompt contains the line 'Whenever a passenger mentions a refund, always start with lookup_order.' What's the most effective first step? (Select ONE.) A) Merge get_refund_status into lookup_order as an extra mode, so that any refund question already reaches the right underlying function. B) Rewrite that system prompt line so it no longer ties the word 'refund' to lookup_order, and say when each refund-related tool applies. C) Add a routing classifier before the agent that detects refund-status questions and forces get_refund_status with tool_choice for them. D) Expand the get_refund_status description further with more example queries, input formats and edge cases so that it outranks lookup_order.

Understand Foundations Mock Exam 2 · Q599 · the situation and each part of the question

The real situation behind this question

Coastline Airways added a dedicated tool for refund status because passengers often ask where their money is after a cancellation. The tool's description is good. But an early version of the system prompt, written before the tool existed, tells the agent to start with lookup_order whenever refunds come up. The agent follows the prompt, so the new tool is rarely used. The team needs the first, most effective fix.

Read the question in parts

Part 1 · a clear, detailed description

the tool description is not the weak point, so improving it further is unlikely to help.

Part 2 · calls it even for questions about the fare refund rules

the misrouting follows the word 'refund', not the meaning of the question, which points to a keyword rule.

What you are being asked to decide

The new tool has a good description, but an old prompt line keeps sending refund questions to the wrong tool. What do you fix first? Tests reviewing system prompts for keyword-sensitive instructions that override tool descriptions.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Tool selectionthe model's choice between lookup_order and get_refund_status for a refund question
System promptthe standing instructions where the old keyword rule about refunds lives

Study: Remove irrelevant tools or explain useful ones? Tool selection System prompt Tool description

Understand Foundations Mock Exam 2 · Q599's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The description is good, but a keyword rule in the system prompt overrides it. Fix the instruction first: remove the 'refund means lookup_order' link and state when each tool applies.

Connect the design to the situation

'Where is my refund?' triggers lookup_order instead of get_refund_status.

Best answer: B. A keyword-sensitive system prompt instruction can override a well-written tool description, and here it tells the agent to call lookup_order whenever 'refund' appears. Removing that association is the cheapest and most direct fix. Improving the description further does not help, because it is already clear and the prompt overrides it.

The decisive evidence in the stem

'Whenever a passenger mentions a refund, always start with lookup_order.' This instruction ties a keyword to one tool, so the agent obeys it even when another tool's description is a better match.

Official objective tested: Task 2.1 · Design effective tool interfaces with clear descriptions and boundaries

What each choice would do here

A · Why this does not meet the full requirement

Merge get_refund_status into lookup_order as an extra mode, so that any refund question already reaches the right underlying function.

Hides a purpose-specific tool inside a broader one, which makes tool boundaries less clear.

lookup_order now does two jobs and needs a mode parameter. The agent must still choose the right mode, so the ambiguity moves inside one tool instead of disappearing.

B · Why this meets the requirement

Rewrite that system prompt line so it no longer ties the word 'refund' to lookup_order, and say when each refund-related tool applies.

Removes the instruction that causes the misrouting, with no new infrastructure.

The line becomes 'For refund status, use get_refund_status; use lookup_order for booking details and itinerary'. The next 'Where is my refund?' goes to get_refund_status, and fare-rule questions no longer trigger any lookup.

C · Why this does not meet the full requirement

Add a routing classifier before the agent that detects refund-status questions and forces get_refund_status with tool_choice for them.

Adds a whole layer to work around one prompt line that can simply be fixed.

The classifier works for the patterns it was trained on, but it is a new component to build, test and maintain. The prompt line still pulls the agent toward lookup_order whenever the classifier misses.

D · Why this does not meet the full requirement

Expand the get_refund_status description further with more example queries, input formats and edge cases so that it outranks lookup_order.

Improves a description that is already clear while the overriding prompt line stays in place.

The description grows longer, but the system prompt still says 'always start with lookup_order' for any refund mention. The model weighs the explicit instruction higher, so selection barely changes.

Check your understanding · explain the design in your own words

The new tool has a good description, but an old prompt line keeps sending refund questions to the wrong tool. What do you fix first?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Remove irrelevant tools or explain useful ones?

Study: Remove irrelevant tools or explain useful ones? Tool selection System prompt Tool description

Return to Foundations Mock Exam 2 · Q599's situation and clause-by-clause explanation

D4 · Tools & MCP

Q600. Coastline Airways keeps 140 policy documents, about 600,000 tokens in total, behind a search_policy MCP tool. Traces show the agent makes four to six exploratory search_policy calls per chat just to discover which policies exist, such as 'pet travel', 'delay compensation' and 'unaccompanied minors'. How can the MCP server reduce these exploratory calls? (Select ONE.) A) Expose a policy catalog as an MCP resource listing each document's title, scope and sections, so the agent sees what exists before searching. B) Load all 140 policy documents into the system prompt so that the agent never has to search for a policy during a chat. C) Tell the agent in the system prompt to make at most two search_policy calls per chat and to escalate if it finds nothing. D) Cache search_policy responses in the MCP server for an hour, so repeated exploratory searches return faster and cost less.

Understand Foundations Mock Exam 2 · Q600 · the situation and each part of the question

The real situation behind this question

Coastline Airways' policies cover baggage, pets, delays, minors travelling alone and more, spread over 140 documents. The agent searches them through search_policy. Because it does not know what exists, it spends several calls per chat probing with guesses before it finds the right document. Each call adds latency and context. The team wants the MCP server to make the policy landscape visible from the start.

Read the question in parts

Part 1 · about 600,000 tokens in total

the documents are far too large to load whole into a prompt, so discovery must be lighter.

Part 2 · four to six exploratory search_policy calls per chat

the waste is in exploration, not in the final policy lookup, so a catalog targets it.

What you are being asked to decide

The agent searches several times just to learn what policies exist. How can it know the list up front? Tests using MCP resources to expose a content catalog instead of exploratory tool calls.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
MCP resourceread-only content the MCP server exposes, here a catalog of the 140 policy documents
MCP tool discoveryhow the agent learns which tools a server offers, which is separate from learning what data exists

Study: MCP resources & config scoping — two details tested by file path MCP resource MCP tool discovery

Understand Foundations Mock Exam 2 · Q600's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The calls are spent discovering what exists. An MCP resource that lists the policy catalog gives that visibility up front, so the agent searches the right document directly.

Connect the design to the situation

Four searches per chat to find out that a 'delay compensation' policy exists.

Best answer: A. MCP resources let a server expose a content catalog, giving the agent visibility into available data without exploratory tool calls. The agent can then search the right policy directly. Loading all documents is impossible at 600,000 tokens, and caching only makes the wasted exploration cheaper.

The decisive evidence in the stem

just to discover which policies exist The calls are spent learning what content is available, which is exactly what a catalog resource supplies up front.

Official objective tested: Task 2.4 · Integrate MCP servers into Claude Code and agent workflows

What each choice would do here

A · Why this meets the requirement

Expose a policy catalog as an MCP resource listing each document's title, scope and sections, so the agent sees what exists before searching.

Shows the agent what exists, so it can go straight to the right policy.

The agent reads the catalog resource: 'Delay compensation, rules by delay length and cause', 'Pet travel, cabin and hold limits'. When a passenger asks about a five-hour delay, it searches that one document directly and answers with one call.

B · Why this does not meet the full requirement

Load all 140 policy documents into the system prompt so that the agent never has to search for a policy during a chat.

600,000 tokens will not fit in a request, and most of it is irrelevant to any one chat.

The request would exceed the context window. Even a cut-down version would push the agent's real conversation into the middle of a huge prompt and raise cost on every chat.

C · Why this does not meet the full requirement

Tell the agent in the system prompt to make at most two search_policy calls per chat and to escalate if it finds nothing.

Limits calls without giving the agent any better way to find the right policy.

The agent stops after two guesses and escalates cases it could solve if it knew the right policy existed. Resolution falls, and the root problem, no visibility, remains.

D · Why this does not meet the full requirement

Cache search_policy responses in the MCP server for an hour, so repeated exploratory searches return faster and cost less.

Makes wasted searches cheaper but does not remove them.

The second identical search is faster, but most exploratory queries differ slightly, so the cache rarely hits. The agent still makes four to six calls, now sometimes with stale results.

Check your understanding · explain the design in your own words

The agent searches several times just to learn what policies exist. How can it know the list up front?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: MCP resources & config scoping — two details tested by file path

Study: MCP resources & config scoping — two details tested by file path MCP resource MCP tool discovery

Return to Foundations Mock Exam 2 · Q600's situation and clause-by-clause explanation

D5 · Context & Reliability

Q601. Long chats are summarized after 25 turns to save context. In one escalated case, the passenger had been promised a $187.40 credit for booking K7Q2PF by Friday, but the summary said only 'passenger discussed a credit for a delayed flight', and the agent later offered $150. How should you preserve such details across long chats? (Select ONE.) A) Keep a case-facts block of amounts, booking references, dates and promises, sent in every request outside the summarized history. B) Instruct the summarizer to be more detailed and to always keep any numbers, dates and booking references that appear in the conversation. C) Summarize less often, every 50 turns instead of every 25, so that more of the original wording stays in context for longer chats. D) Move the agent to a model with a much larger context window, so long chats never need to be summarized in the first place.

Understand Foundations Mock Exam 2 · Q601 · the situation and each part of the question

The real situation behind this question

Coastline Airways' agent summarizes long chats to keep context small. In one case, an agent turn promised a passenger a $187.40 credit for a delayed flight by Friday. Later the summary became vague, the agent lost the exact amount, and it offered $150. The passenger felt cheated and asked for a human. The team must keep exact commitments intact across long chats.

Read the question in parts

Part 1 · Long chats are summarized after 25 turns

summarization is necessary here, so the fix must work alongside it, not remove it.

Part 2 · the agent later offered $150

losing an exact number caused a wrong action, not just an imprecise summary.

What you are being asked to decide

A summary turned an exact promise into a vague sentence. How do you stop exact facts from disappearing? Tests persisting transactional facts in a case-facts block outside summarized history.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Compactionreplacing older turns with a shorter summary to free context space
Context budgetthe share of the context window spent on history versus facts that must survive

Study: Long-conversation strategy (support-agent scenario) Compaction Context budget

Understand Foundations Mock Exam 2 · Q601's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Summaries blur exact numbers and promises. Extract amounts, booking references, dates and commitments into a case-facts block sent with every request, separate from the summarized history.

Connect the design to the situation

A promised $187.40 credit becomes 'discussed a credit', and the agent offers $150.

Best answer: A. Progressive summarization tends to compress exact amounts, dates and promises into vague text. Extracting transactional facts into a persistent block that is sent with every request, separate from the summary, protects them by design. A more careful summarizer still depends on the model choosing what to keep each time.

The decisive evidence in the stem

the summary said only 'passenger discussed a credit for a delayed flight' Summarization dropped the exact amount, booking and deadline, which shows these facts need storage outside the summary.

Official objective tested: Task 5.1 · Manage conversation context to preserve critical information across long interactions

What each choice would do here

A · Why this meets the requirement

Keep a case-facts block of amounts, booking references, dates and promises, sent in every request outside the summarized history.

Stores exact facts in a structure that summarization never touches.

After the promise, the harness records {booking: K7Q2PF, credit: 187.40, due: Friday, status: promised}. Every later request includes this block above the summary, so the agent offers exactly $187.40 even at turn 60.

B · Why this does not meet the full requirement

Instruct the summarizer to be more detailed and to always keep any numbers, dates and booking references that appear in the conversation.

Still relies on the summarizer's choices each time it runs, so facts can still be lost.

The summarizer keeps more numbers, but it may still merge two amounts or drop a deadline in a busy chat. Whether a fact survives still depends on one model pass.

C · Why this does not meet the full requirement

Summarize less often, every 50 turns instead of every 25, so that more of the original wording stays in context for longer chats.

Delays the loss but still sends exact facts through a lossy summary.

Chats under 50 turns are safer, but the longest and most complex chats, the ones most likely to escalate, still go through a summary that can blur the amount.

D · Why this does not meet the full requirement

Move the agent to a model with a much larger context window, so long chats never need to be summarized in the first place.

Postpones summarization but does not protect facts in chats that grow longer still.

Most chats now fit without summarizing, at a higher cost per turn. Very long chats still hit the limit, and information in the middle of long inputs can still be missed.

Walk through complete payloads or code · every step explained

Illustrative examples, not recorded live calls. Check each block's direction and endpoint: API requests, API responses, MCP messages, and configuration files are different contracts.

Case-facts block sent with every request (illustrative)

JSON
{"case_facts": {"customer_id": "C-30417", "bookings": [{"booking_ref": "K7Q2PF", "issue": "delayed flight", "credit_promised_usd": 187.40, "credit_due": "Friday", "status": "promised"}]}}

The harness updates this block when a fact changes and places it in each request outside the summarized history.

Which omitted settings use defaults or leave features unconfigured?

Check your understanding · explain the design in your own words

A summary turned an exact promise into a vague sentence. How do you stop exact facts from disappearing?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Long-conversation strategy (support-agent scenario)

Study: Long-conversation strategy (support-agent scenario) Compaction Context budget

Return to Foundations Mock Exam 2 · Q601's situation and clause-by-clause explanation

D4 · Tools & MCP

Q602. process_refund returns {"error": "Operation failed"} both when the payment gateway times out and when a ticket is a non-refundable basic fare. The agent retries the fare-rule failures three times and then tells passengers to try again later. For gateway timeouts, it sometimes gives up after one attempt. What change lets the agent respond correctly to each case? (Select ONE.) A) Log the full gateway error server-side and keep the generic message, so passengers never see technical details from the backend. B) Tell the agent in the system prompt to retry each failed refund exactly once and then escalate any case that still fails afterward. C) Make process_refund retry every failure automatically three times with backoff before returning, so the agent sees only final outcomes. D) Return isError with an errorCategory such as transient or business, an isRetryable flag, and a passenger-friendly fare-rule message.

Understand Foundations Mock Exam 2 · Q602 · the situation and each part of the question

The real situation behind this question

Coastline Airways' refund tool fails for two very different reasons: the payment gateway is slow, or the ticket is a basic fare that cannot be refunded. Both failures return the same message. So the agent keeps retrying refunds that the fare rules forbid, then tells passengers to try later, which is wrong. And it gives up too early on timeouts that a retry would fix. The team must change what the tool returns.

Read the question in parts

Part 1 · retries the fare-rule failures three times

the agent cannot see that a business rule failure is not retryable, so it wastes calls.

Part 2 · it sometimes gives up after one attempt

retryable transient errors are also mishandled, because they look like any other failure.

What you are being asked to decide

The refund tool says 'Operation failed' for every problem. How should it report errors? Tests structured MCP error responses that separate transient from business errors.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Error taxonomythe categories (transient, validation, business, permission) that tell the agent how to recover
MCP serverthe backend service that implements process_refund and decides what its error responses contain

Study: The MCP error contract — isError and structured error metadata Error taxonomy MCP server

Understand Foundations Mock Exam 2 · Q602's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The same message for opposite failures blocks the right recovery. Return isError with a category, a retryable flag and a passenger-friendly explanation, so the agent retries timeouts and explains fare rules.

Connect the design to the situation

A timeout and a non-refundable fare both return the same message.

Best answer: D. A uniform 'Operation failed' hides the one fact the agent needs: whether trying again can work. Structured metadata separates a retryable transient timeout from a non-retryable business rule and gives the agent wording for the passenger. Automatic retries inside the tool waste three calls on a fare-rule failure that can never succeed.

The decisive evidence in the stem

both when the payment gateway times out and when a ticket is a non-refundable basic fare Two failures with opposite recovery paths look identical, so the agent cannot choose between retrying and explaining the fare rule.

Official objective tested: Task 2.2 · Implement structured error responses for MCP tools

What each choice would do here

A · Why this does not meet the full requirement

Log the full gateway error server-side and keep the generic message, so passengers never see technical details from the backend.

Logging helps engineers, but the agent still cannot tell the two failures apart.

Engineers can debug from the logs, but the agent's behaviour does not change. A non-technical message is good practice; the defect is that the agent cannot tell what kind of failure occurred.

B · Why this does not meet the full requirement

Tell the agent in the system prompt to retry each failed refund exactly once and then escalate any case that still fails afterward.

A fixed rule still treats both failures alike, so fare-rule cases are retried and escalated for no reason.

Fare-rule failures are retried once and then escalated to humans, who simply confirm the rule. Timeouts that need two retries are escalated too early. Both cases are still handled by one blind rule.

C · Why this does not meet the full requirement

Make process_refund retry every failure automatically three times with backoff before returning, so the agent sees only final outcomes.

Retries fare-rule failures that can never succeed and still returns one opaque message.

Every basic-fare refund request now triggers three gateway calls before failing. The agent still gets 'Operation failed' and still cannot explain the fare rule to the passenger.

D · Why this meets the requirement

Return isError with an errorCategory such as transient or business, an isRetryable flag, and a passenger-friendly fare-rule message.

Gives the agent the category and retryability it needs, plus wording it can use with the passenger.

A timeout returns errorCategory 'transient' and isRetryable true, so the agent retries. A basic fare returns 'business', isRetryable false and 'Basic fares are non-refundable; a travel credit may be available', so the agent explains the rule and offers alternatives.

Walk through complete payloads or code · every step explained

Illustrative examples, not recorded live calls. Check each block's direction and endpoint: API requests, API responses, MCP messages, and configuration files are different contracts.

Two structured error results (illustrative)

JSON
[{"isError": true, "content": [{"type": "text", "text": "{\"errorCategory\": \"transient\", \"isRetryable\": true, \"message\": \"Payment gateway timed out\"}"}]}, {"isError": true, "content": [{"type": "text", "text": "{\"errorCategory\": \"business\", \"isRetryable\": false, \"customerMessage\": \"Basic fares are non-refundable; a travel credit may be available.\"}"}]}]

Both results set isError, but the metadata tells the agent to retry the first and explain the second.

Which omitted settings use defaults or leave features unconfigured?

Check your understanding · explain the design in your own words

The refund tool says 'Operation failed' for every problem. How should it report errors?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: The MCP error contract — isError and structured error metadata

Study: The MCP error contract — isError and structured error metadata Error taxonomy MCP server

Return to Foundations Mock Exam 2 · Q602's situation and clause-by-clause explanation

D5 · Context & Reliability

Q603. Each lookup_order result contains about 60 fields, including fare basis codes, aircraft tail numbers and tax breakdowns. Passengers with many bookings fill the context after a few lookups, and the agent has started missing details the passenger stated early in the chat. Refund handling needs about six of those fields. What change should you make? (Select ONE.) A) Trim each lookup_order result to the fields that refund handling needs before it is added to the conversation context. B) Instruct the agent in the system prompt to ignore fare-basis, aircraft and tax fields when it reads any lookup_order result. C) Trigger compaction more often, so older lookup_order results are summarized sooner when the context becomes too full. D) Use a model with a larger context window, so many full lookup_order results can fit alongside the whole conversation.

Understand Foundations Mock Exam 2 · Q603 · the situation and each part of the question

The real situation behind this question

Coastline Airways' booking system returns everything it knows about a booking: 60 fields, many of them for revenue and operations staff. When a frequent flyer with ten bookings asks about refunds, the agent's context fills with fare codes and tax lines. The agent begins to forget what the passenger said at the start, such as which flight was cancelled. The team wants to keep the context focused on what support needs.

Read the question in parts

Part 1 · about 60 fields

each lookup is large, so a few calls are enough to dominate the context.

Part 2 · missing details the passenger stated early in the chat

irrelevant booking data is crowding out the important things the passenger said earlier.

What you are being asked to decide

Booking lookups return 60 fields but only six matter, and the context fills up. What do you do? Tests trimming verbose tool outputs to relevant fields before they accumulate in context.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Context budgetthe limited space each request has, now mostly spent on unused booking fields
tool_resultthe booking data returned to the agent, which can be trimmed before it enters the conversation

Study: Context management Context budget tool_result

Understand Foundations Mock Exam 2 · Q603's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Most of each lookup is irrelevant, and tool results pile up in context. Trim results to the six support fields before they are appended; this saves space and keeps the passenger's details in focus.

Connect the design to the situation

Ten booking lookups with fare codes and tax data push the passenger's early details out of focus.

Best answer: A. Tool results accumulate in context and consume tokens far beyond their relevance. Removing irrelevant fields before they reach the context keeps the useful facts and frees space for the conversation. A prompt to ignore fields does not remove a single token.

The decisive evidence in the stem

needs about six of those fields Most of each result is irrelevant to the task, so trimming before accumulation saves context without losing anything the agent uses.

Official objective tested: Task 5.1 · Manage conversation context to preserve critical information across long interactions

What each choice would do here

A · Why this meets the requirement

Trim each lookup_order result to the fields that refund handling needs before it is added to the conversation context.

Keeps what the task uses and stops irrelevant data from taking context space.

A trimming step in the tool or a result hook keeps booking_ref, flights, travel dates, status, amount paid and refund eligibility. Ten lookups now take a fraction of the space, and the passenger's early statements stay clearly in context.

B · Why this does not meet the full requirement

Instruct the agent in the system prompt to ignore fare-basis, aircraft and tax fields when it reads any lookup_order result.

The ignored fields still occupy context, so the space problem remains.

The agent may read past the fields, but every token still counts toward the window. Context still fills after a few lookups, and early details still get crowded out.

C · Why this does not meet the full requirement

Trigger compaction more often, so older lookup_order results are summarized sooner when the context becomes too full.

Summarizes useful conversation details along with the noise.

Compaction runs sooner and summarizes the start of the chat, which is where the passenger's own statements are. The noisy fields are summarized together with important details, so precision drops.

D · Why this does not meet the full requirement

Use a model with a larger context window, so many full lookup_order results can fit alongside the whole conversation.

Fits more noise and costs more per call while the key facts remain diluted.

Everything fits for longer, but each request costs more, and important details are still a small part of a long input. The real issue, 54 unused fields per lookup, is unchanged.

Check your understanding · explain the design in your own words

Booking lookups return 60 fields but only six matter, and the context fills up. What do you do?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Context management

Study: Context management Context budget tool_result

Return to Foundations Mock Exam 2 · Q603's situation and clause-by-clause explanation

Scenario 2 · Developer Productivity with Claude

D1 · Agentic Architecture

Q604. A teammate proposes a fixed sequence for every Compass request to make runs predictable: Glob for files whose names match the request's keywords, Read the top five, then answer. Many requests are investigations, such as 'why does the nightly invoice job post twice?', where the next step depends on what a log, a test run or a caller reveals. Which design should Compass use for these requests? (Select ONE.) A) Let Claude choose each next tool from the results so far, and keep looping while it requests tools until it ends the turn with an answer. B) Use the fixed Glob-Read sequence for every request, and raise the number of files read from five to twenty to improve coverage. C) Run the fixed Glob-Read sequence first, then allow further tool calls only if Claude's answer contains a phrase such as 'need more information'. D) Build a decision tree that maps question words such as 'why', 'where' and 'how' to a predefined tool sequence written for each type of question.

Understand Foundations Mock Exam 2 · Q604 · the situation and each part of the question

The real situation behind this question

Compass engineers ask it all kinds of questions. Some are predictable, but many are investigations: a job posts invoices twice, a test fails only on Mondays. A teammate wants to make every run follow one recipe so it is easier to predict. The architect has to decide whether that recipe fits the investigations, where the answer appears only after following clues through logs, tests and code.

Read the question in parts

Part 1 · Glob for files whose names match the request's keywords

the fixed sequence finds files by name only, which cannot follow evidence inside code or logs.

Part 2 · to make runs predictable

predictability is a real benefit, but it is the wrong priority for open-ended investigation.

What you are being asked to decide

Should Compass follow a fixed recipe for every request, or let Claude pick each next tool? Tests model-driven tool decisions versus pre-configured sequences in an agentic loop.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Agent loopCompass calling Claude, running the tool it asks for, and calling it again with the result
Workflowa fixed, predefined path of steps, which suits predictable tasks but not investigations

Study: The agentic loop — the exam's core object Agent loop Workflow

Understand Foundations Mock Exam 2 · Q604's answer · full reasoning and worked examples
Claude synthesized · the point, straight

In an investigation the next step depends on the last result. So the model must choose each tool from context, with the loop continuing while it requests tools. Fixed sequences and decision trees cannot follow new leads.

Connect the design to the situation

Finding why a nightly job posts invoices twice needs leads that no fixed recipe predicts.

Best answer: A. Investigations are open-ended: which file, test or log to check next depends on the previous result, so the model should decide the next tool from context. A question-word decision tree is still a pre-configured sequence and cannot follow a lead it did not anticipate.

The decisive evidence in the stem

the next step depends on what a log, a test run or a caller reveals When each step depends on the last result, no fixed sequence can be written in advance, so the decision must be model-driven.

Official objective tested: Task 1.1 · Design and implement agentic loops for autonomous task execution

What each choice would do here

A · Why this meets the requirement

Let Claude choose each next tool from the results so far, and keep looping while it requests tools until it ends the turn with an answer.

Lets each tool choice follow from the evidence found so far, which is what investigations need.

Claude greps the job's logs, sees two scheduler entries, reads the cron config, then runs a Bash check on the scheduler. Each step comes from the last result. The loop ends when Claude returns end_turn with the cause: two schedulers registered after a deploy.

B · Why this does not meet the full requirement

Use the fixed Glob-Read sequence for every request, and raise the number of files read from five to twenty to improve coverage.

Reads more files by name but still never runs tests, greps logs or follows callers.

Compass reads twenty files with 'invoice' in their names, using more context, and still never looks at the scheduler or runs a test. More of the same fixed step does not make it adaptive.

C · Why this does not meet the full requirement

Run the fixed Glob-Read sequence first, then allow further tool calls only if Claude's answer contains a phrase such as 'need more information'.

Uses text phrases to decide whether to continue, a fragile signal for loop control.

The first answer is based on five files that happened to match 'invoice'. Whether Compass continues depends on Claude writing a specific phrase, so a confident but wrong answer ends the run early.

D · Why this does not meet the full requirement

Build a decision tree that maps question words such as 'why', 'where' and 'how' to a predefined tool sequence written for each type of question.

Is still a pre-written sequence and cannot follow an unexpected lead.

'Why' maps to Grep-then-Read. The real cause sits in a scheduler config that no grep keyword reached, and the tree has no branch for running the scheduler check, so the investigation stalls.

Check your understanding · explain the design in your own words

Should Compass follow a fixed recipe for every request, or let Claude pick each next tool?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: The agentic loop — the exam's core object

Study: The agentic loop — the exam's core object Agent loop Workflow

Return to Foundations Mock Exam 2 · Q604's situation and clause-by-clause explanation

D1 · Agentic Architecture

Q605. An engineer asks Compass to 'add meaningful tests to the legacy billing package', which has 140 Kotlin files and almost no tests. The first attempt wrote tests file by file in alphabetical order and spent most of its budget on small formatting utilities, while the invoice-posting path stayed untested. How should Compass decompose this task? (Select ONE.) A) Keep the file-by-file chain but sort the files by line count, so that the largest files are tested first and receive most of the budget. B) Spawn 140 parallel subagents, one per file, each writing tests for its own file, then merge all the resulting test files at the end. C) Ask Compass to reach 100% line coverage across the package, so that every file must get tests and the budget is spread evenly. D) Map the package structure first, identify high-impact areas such as money-moving paths, then follow a prioritized plan that adapts as dependencies are discovered.

Understand Foundations Mock Exam 2 · Q605 · the situation and each part of the question

The real situation behind this question

Saltmarsh Payments' legacy billing package moves real money but has almost no tests. An engineer asked Compass to fix that. Compass worked through files alphabetically and wrote careful tests for string formatters, then ran out of budget before reaching the code that posts invoices to the ledger. The architect must change how Compass breaks down this open-ended task. Budget is limited and must count.

Read the question in parts

Part 1 · file by file in alphabetical order

the first attempt used a fixed chain that ignored what each file does.

Part 2 · the invoice-posting path stayed untested

the most important code was missed, which is the cost of not prioritizing.

What you are being asked to decide

Testing files alphabetically wasted effort on unimportant code. How should Compass plan an open-ended testing job? Tests dynamic, prioritized decomposition for open-ended tasks versus fixed sequential chains.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Decompositionbreaking 'add meaningful tests' into a plan based on what the package actually contains
Prompt chaininga fixed sequence of steps, suited to predictable work rather than open-ended investigation

Study: Workflows vs agents — Anthropic's decision rule Decomposition Prompt chaining

Understand Foundations Mock Exam 2 · Q605's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The task is open-ended, and a fixed order wasted effort. Map the structure, prioritize high-impact paths, and adapt the plan as dependencies appear. Fixed chains suit predictable work, not this.

Connect the design to the situation

Formatting helpers get tests while invoice posting gets none.

Best answer: D. An open-ended task needs dynamic decomposition: first understand the structure, then target the areas where tests matter most, and adapt the plan as hidden dependencies appear. A fixed per-file chain, whatever its sort order, cannot judge impact or react to what it finds.

The decisive evidence in the stem

spent most of its budget on small formatting utilities The fixed order did not reflect importance, so the decomposition must start by finding where tests have the most value.

Official objective tested: Task 1.6 · Design task decomposition strategies for complex workflows

What each choice would do here

A · Why this does not meet the full requirement

Keep the file-by-file chain but sort the files by line count, so that the largest files are tested first and receive most of the budget.

Size is not impact; a large generated file may matter less than a small posting class.

The largest file is a generated mapping table with no logic. Compass spends its budget there, and the small but critical InvoicePoster class is still reached late or not at all.

B · Why this does not meet the full requirement

Spawn 140 parallel subagents, one per file, each writing tests for its own file, then merge all the resulting test files at the end.

Ignores cross-file dependencies and spends budget on every file equally.

140 subagents each test one file in isolation. Files that need shared fixtures or a mocked ledger produce inconsistent setups, and the merged result is large but shallow.

C · Why this does not meet the full requirement

Ask Compass to reach 100% line coverage across the package, so that every file must get tests and the budget is spread evenly.

Coverage targets reward easy lines, not meaningful tests on risky paths.

Compass writes tests that execute every line of the formatters and generated code. Coverage rises, but the tests for posting logic are as thin as everything else.

D · Why this meets the requirement

Map the package structure first, identify high-impact areas such as money-moving paths, then follow a prioritized plan that adapts as dependencies are discovered.

Directs effort to the paths that matter and lets the plan change as Compass learns.

Compass maps entry points and call graphs, finds that InvoicePoster and RefundLedger move money, and plans tests there first. Writing those tests reveals a hidden dependency on a currency service, so it adds a fixture task to the plan before continuing.

Check your understanding · explain the design in your own words

Testing files alphabetically wasted effort on unimportant code. How should Compass plan an open-ended testing job?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Workflows vs agents — Anthropic's decision rule

Study: Workflows vs agents — Anthropic's decision rule Decomposition Prompt chaining

Return to Foundations Mock Exam 2 · Q605's situation and clause-by-clause explanation

D2 · Claude Code

Q606. Saltmarsh Payments wants to replace its in-house logging wrapper with SLF4J across about 60 modules. Some modules pass request IDs through the wrapper's thread-local context, and the team has not decided how to carry them through coroutines. An engineer plans to start Claude Code in direct execution and fix modules one by one. Which approach should the engineer take? (Select ONE.) A) Split the work into 60 separate direct-execution sessions, one per module, so each session stays small and focused. B) Use plan mode to explore usages and decide request-ID propagation, then use direct execution to apply the approved plan. C) Use direct execution throughout and commit after each module, so any mistakes in the propagation design can be reverted later. D) Use plan mode for the whole migration, including editing all 60 modules, so that no file is changed outside the planning phase.

Understand Foundations Mock Exam 2 · Q606 · the situation and each part of the question

The real situation behind this question

Saltmarsh Payments' logging wrapper is old and leaks request IDs between threads. Replacing it touches about 60 modules, and the team still has to decide how request IDs should travel through Kotlin coroutines. An engineer wants to start editing immediately to make progress. The architect must recommend how to run this change with Claude Code without causing costly rework. Rework would be expensive.

Read the question in parts

Part 1 · across about 60 modules

a large multi-file change, where mistakes multiply across many files.

Part 2 · start Claude Code in direct execution and fix modules one by one

the proposed approach skips the design step that the open decision requires.

What you are being asked to decide

A 60-module migration has an open design question. Plan first, or just start editing? Tests combining plan mode for investigation with direct execution for implementation.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Claude Codethe CLI the engineer uses, which offers plan mode and direct execution
Permission modethe session mode setting; plan mode lets Claude explore and propose without editing files

Study: Plan mode vs direct execution — and the Explore subagent Claude Code Permission mode

Understand Foundations Mock Exam 2 · Q606's answer · full reasoning and worked examples
Claude synthesized · the point, straight

A large change with an open design decision needs exploration first. Plan in plan mode, approve the design, then execute directly. Editing first risks rework across all 60 modules.

Connect the design to the situation

Moving to SLF4J without having decided how request IDs travel through coroutines.

Best answer: B. The task spans many files and has an unresolved design decision, so it needs exploration and a plan before edits. Once the plan is approved, direct execution applies it efficiently. Plan mode is for investigation and design, not for carrying out the edits themselves.

The decisive evidence in the stem

the team has not decided how to carry them through coroutines An open architectural decision means editing first would likely lead to rework across many modules.

Official objective tested: Task 3.4 · Determine when to use plan mode vs direct execution

What each choice would do here

A · Why this does not meet the full requirement

Split the work into 60 separate direct-execution sessions, one per module, so each session stays small and focused.

Each session decides propagation on its own, producing inconsistent designs.

Sixty sessions each make their own choice about request IDs. Some use MDC, others pass parameters, and the codebase ends up with three inconsistent propagation styles.

B · Why this meets the requirement

Use plan mode to explore usages and decide request-ID propagation, then use direct execution to apply the approved plan.

Settles the design before edits, then implements efficiently once the plan is approved.

In plan mode, Claude maps every use of the wrapper's context, compares an MDC-based approach with a coroutine context element, and proposes a plan. The team approves the coroutine element. Claude then switches to direct execution and migrates modules consistently.

C · Why this does not meet the full requirement

Use direct execution throughout and commit after each module, so any mistakes in the propagation design can be reverted later.

Edits before the design is decided, so early modules may need redoing.

Claude migrates twenty modules using thread-local MDC. Then tests show request IDs lost across coroutine switches. The design changes, and the twenty commits must be redone.

D · Why this does not meet the full requirement

Use plan mode for the whole migration, including editing all 60 modules, so that no file is changed outside the planning phase.

Plan mode does not make edits; implementation needs direct execution.

Plan mode lets Claude explore and propose, not edit files. The engineer still needs to leave plan mode to implement, so this does not describe a workable approach.

Check your understanding · explain the design in your own words

A 60-module migration has an open design question. Plan first, or just start editing?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Plan mode vs direct execution — and the Explore subagent

Study: Plan mode vs direct execution — and the Explore subagent Claude Code Permission mode

Return to Foundations Mock Exam 2 · Q606's situation and clause-by-clause explanation

D4 · Tools & MCP

Q607. Compass connects to two MCP servers: a community issue-tracker server with a search_issues tool, and an internal server with find_tickets, which actually searches incident postmortems. Both descriptions say 'Search tickets by keyword'. When engineers ask 'has this outage happened before?', Compass calls search_issues and misses the postmortems. What's the most effective first step? (Select ONE.) A) Disconnect the community issue-tracker server, so that find_tickets is the only search tool Compass can use when engineers ask about tickets. B) Build a routing layer that classifies each question as outage-related or not and forces the matching tool with tool_choice for that turn. C) Rename find_tickets to search_incident_postmortems and rewrite its description to explain what it searches, what it returns, and when to use it instead of search_issues. D) Add few-shot examples to Compass's system prompt showing outage questions answered with find_tickets and feature questions answered with search_issues.

Understand Foundations Mock Exam 2 · Q607 · the situation and each part of the question

The real situation behind this question

Compass has two search tools that sound the same. One searches the issue tracker; the other, built by Saltmarsh Payments' reliability team, searches incident postmortems. Their descriptions are identical, so when engineers ask whether an outage happened before, Compass usually searches the issue tracker and misses the postmortem that explains the fix. The team wants Compass to reach the postmortems for these questions.

Read the question in parts

Part 1 · which actually searches incident postmortems

the tool's real purpose is hidden by its generic name and description.

Part 2 · Compass calls search_issues and misses the postmortems

the misrouting has a concrete cost: past fixes are not found.

What you are being asked to decide

Two tools from different servers have the same description, so Compass picks the wrong one. What do you fix first? Tests renaming and rewriting overlapping tool descriptions to remove misrouting.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Tool descriptionthe text that should tell Compass that one tool searches postmortems and the other searches issues
Tool selectionCompass choosing between search_issues and find_tickets for an outage question

Study: Remove irrelevant tools or explain useful ones? Tool description Tool selection

Understand Foundations Mock Exam 2 · Q607's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Identical descriptions make the tools indistinguishable. Rename the internal tool and describe its purpose, outputs and when to prefer it; that removes the overlap at the source.

Connect the design to the situation

'Has this outage happened before?' goes to the issue tracker instead of postmortems.

Best answer: C. Near-identical descriptions cause misrouting because tool descriptions are the main way the model chooses among tools. Renaming the internal tool and describing its real purpose removes the overlap at its source. Few-shot examples could help later, but they work around a misleading name and description that should simply be fixed.

The decisive evidence in the stem

Both descriptions say 'Search tickets by keyword' The model has no way to tell the two tools apart, so the descriptions and names must differentiate them.

Official objective tested: Task 2.1 · Design effective tool interfaces with clear descriptions and boundaries

What each choice would do here

A · Why this does not meet the full requirement

Disconnect the community issue-tracker server, so that find_tickets is the only search tool Compass can use when engineers ask about tickets.

Removes a useful tool that engineers need for ordinary issue searches.

Outage questions now reach postmortems, but 'find the open bug for the login page' has no tool left to answer it. Compass loses a capability engineers rely on every day.

B · Why this does not meet the full requirement

Build a routing layer that classifies each question as outage-related or not and forces the matching tool with tool_choice for that turn.

Adds infrastructure for a problem that clear descriptions solve.

The classifier must be trained and maintained, and forcing a tool removes Compass's own judgment for mixed questions. The tools still look identical to the model.

C · Why this meets the requirement

Rename find_tickets to search_incident_postmortems and rewrite its description to explain what it searches, what it returns, and when to use it instead of search_issues.

Fixes the overlap where it starts: the name and the description the model reads.

The tool becomes search_incident_postmortems: 'Searches post-incident reviews by service, symptom or date. Use for questions about past outages; use search_issues for feature and bug tickets'. The next outage question reaches the right tool.

D · Why this does not meet the full requirement

Add few-shot examples to Compass's system prompt showing outage questions answered with find_tickets and feature questions answered with search_issues.

Works around a misleading tool name and description instead of correcting them.

Examples improve some outage questions, but the identical name and description still mislead the model on phrasings the examples did not cover, so misrouting continues for new kinds of questions.

Check your understanding · explain the design in your own words

Two tools from different servers have the same description, so Compass picks the wrong one. What do you fix first?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Remove irrelevant tools or explain useful ones?

Study: Remove irrelevant tools or explain useful ones? Tool description Tool selection

Return to Foundations Mock Exam 2 · Q607's situation and clause-by-clause explanation

D1 · Agentic Architecture

Q608. For a request to 'document every external dependency of the billing package', the coordinator spawns three explorer subagents, each told to 'find external dependencies in billing'. Their reports overlap by about 70%: all three read the same HTTP client wrappers, and none looked at the message-queue consumers. How should the coordinator split this kind of work? (Select ONE.) A) Keep the same instructions and spawn five explorers instead of three, so that random variation makes it more likely every area is reached. B) Give each explorer a distinct slice of scope, such as HTTP clients, queue consumers, or database access, so that together they cover the package without overlap. C) Let the three explorers share a scratch file where each one writes what it has read, so the others can skip files already covered. D) Spawn one explorer with a longer time budget instead of three, so that a single agent reads the whole package from start to finish.

Understand Foundations Mock Exam 2 · Q608 · the situation and each part of the question

The real situation behind this question

Saltmarsh Payments wants a list of every external system the billing package talks to. Compass's coordinator sends three explorers with the same short instruction to speed things up. They come back with nearly identical reports about HTTP clients, and the message-queue consumers that call two partner systems are missing. The architect must change how the coordinator divides the work. Time matters too.

Read the question in parts

Part 1 · Their reports overlap by about 70%

most of the parallel work was wasted, which points to how the work was split.

Part 2 · none looked at the message-queue consumers

identical instructions also caused a coverage gap, not just duplication.

What you are being asked to decide

Three explorers did nearly the same work and missed one area. How should the coordinator divide the task? Tests partitioning research scope across parallel subagents to avoid duplication and gaps.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Hub-and-spokethe coordinator at the centre assigning and collecting all subagent work
Decompositionsplitting 'all external dependencies' into separate slices such as HTTP, queues and databases

Study: Coordinator communication from plan to final report Hub-and-spoke Decomposition

Understand Foundations Mock Exam 2 · Q608's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Identical instructions produce duplicated work and gaps. The coordinator should split scope into distinct slices, one per subagent, so parallel work covers the whole package once.

Connect the design to the situation

Three explorers all read the HTTP wrappers; nobody reads the queue consumers.

Best answer: B. When parallel subagents get identical instructions, they explore the same obvious areas and leave gaps. Partitioning the scope by distinct subtopics or source types removes duplication and ensures coverage. A shared scratch file adds coordination between subagents that should be the coordinator's job, and it still leaves no one responsible for the queue consumers.

The decisive evidence in the stem

each told to 'find external dependencies in billing' Identical instructions give each explorer the same starting points, which explains both the overlap and the gap.

Official objective tested: Task 1.2 · Orchestrate multi-agent systems with coordinator-subagent patterns

What each choice would do here

A · Why this does not meet the full requirement

Keep the same instructions and spawn five explorers instead of three, so that random variation makes it more likely every area is reached.

More copies of the same instructions add more of the same overlap.

Five explorers spend five times the tokens. With the same instruction, most still start with the obvious HTTP wrappers, and coverage of queues depends on luck.

B · Why this meets the requirement

Give each explorer a distinct slice of scope, such as HTTP clients, queue consumers, or database access, so that together they cover the package without overlap.

Gives each explorer its own territory, removing overlap and assigning every area to someone.

The coordinator assigns HTTP clients to one explorer, queue consumers to another, and database and file access to a third. Reports no longer overlap, and the queue explorer finds the two partner systems everyone missed.

C · Why this does not meet the full requirement

Let the three explorers share a scratch file where each one writes what it has read, so the others can skip files already covered.

Moves coordination into the subagents and still leaves no one assigned to the gap.

Explorers now race to claim files and read each other's notes. All three still start from the obvious HTTP code, and no explorer is told to own queues, so the gap can remain.

D · Why this does not meet the full requirement

Spawn one explorer with a longer time budget instead of three, so that a single agent reads the whole package from start to finish.

Removes duplication but also removes the parallelism, and one long run risks context exhaustion.

One explorer reads the package alone, taking three times as long. Its context fills with HTTP wrapper code, and it may still stop before reaching the queue consumers.

Check your understanding · explain the design in your own words

Three explorers did nearly the same work and missed one area. How should the coordinator divide the task?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Coordinator communication from plan to final report

Study: Coordinator communication from plan to final report Hub-and-spoke Decomposition

Return to Foundations Mock Exam 2 · Q608's situation and clause-by-clause explanation

D4 · Tools & MCP

Q609. An engineer asks Compass to find every caller of the TypeScript function postLedgerEntry before changing its signature. Compass greps for 'postLedgerEntry' and finds 6 callers, but the change breaks 15 files. The module billing/index.ts re-exports the function as postEntry and recordLedger, and some services import those names. How should Compass trace callers next time? (Select ONE.) A) Use Glob with **/ledger.ts to find every file with 'ledger' in its name, then Read each matching file to look for calls. B) Grep for 'postLedgerEntry' with case-insensitive matching enabled, so that variations in capitalization are also included in the results. C) Read the wrapper modules to list every exported name for the function, then Grep for each name across the codebase to find all callers. D) Read every TypeScript file in the services directory upfront, so that no import or call can be missed during the search.

Understand Foundations Mock Exam 2 · Q609 · the situation and each part of the question

The real situation behind this question

A Saltmarsh Payments engineer planned a small signature change and asked Compass for all callers. Compass searched for the function's name and found six. The change then broke fifteen files, because a wrapper module exports the same function under two other names, and many services use those names. The team wants Compass to trace usage correctly through such wrappers. Breakages are costly.

Read the question in parts

Part 1 · Compass greps for 'postLedgerEntry' and finds 6 callers

Grep was the right tool, but searching for one name was incomplete.

Part 2 · some services import those names

callers can reference the function without ever writing its original name.

What you are being asked to decide

A function is used under other names through re-exports. How do you find all its callers? Tests tracing function usage across wrapper modules by listing exported names and grepping each.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Grepthe built-in tool that searches file contents for a pattern such as a function name
Globthe built-in tool that finds files by path or name pattern, not by what they contain

Study: Built-in tools — the selection criteria (Read, Write, Edit, Bash, Grep, Glob) Grep Glob

Understand Foundations Mock Exam 2 · Q609's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Aliases mean the function has several names. List the exported names from the wrapper first, then Grep each across the codebase. Glob finds files by name, not by usage.

Connect the design to the situation

Six callers found, fifteen broken, because of aliases in billing/index.ts.

Best answer: C. Callers that import the function under a re-exported alias never contain the original name, so a single Grep misses them. Identifying every exported name first, then searching for each, finds all callers. Reading every file upfront would work in principle but wastes context and time.

The decisive evidence in the stem

re-exports the function as postEntry and recordLedger The function has three names in use, so searching for one name cannot find every caller.

Official objective tested: Task 2.5 · Select and apply built-in tools (Read, Write, Edit, Bash, Grep, Glob) effectively

What each choice would do here

A · Why this does not meet the full requirement

Use Glob with **/ledger.ts to find every file with 'ledger' in its name, then Read each matching file to look for calls.

Finds files by name, but callers can live in any file with any name.

Glob returns files such as ledgerTypes.ts and ledgerUtils.ts. Many callers live in files such as checkout.ts and payouts.ts, which Glob never finds because their names do not contain 'ledger'.

B · Why this does not meet the full requirement

Grep for 'postLedgerEntry' with case-insensitive matching enabled, so that variations in capitalization are also included in the results.

Capitalization is not the problem; the aliases are different words.

The search still looks for 'postledgerentry' in any case. Files that import postEntry or recordLedger still do not match, so the nine missed callers are still missed.

C · Why this meets the requirement

Read the wrapper modules to list every exported name for the function, then Grep for each name across the codebase to find all callers.

Finds all aliases first, then searches content for each, so every caller is found.

Compass reads billing/index.ts and sees 'export { postLedgerEntry as postEntry, postLedgerEntry as recordLedger }'. It greps for all three names and finds fifteen callers, matching the files that broke.

D · Why this does not meet the full requirement

Read every TypeScript file in the services directory upfront, so that no import or call can be missed during the search.

Works by brute force and floods the context with unrelated code.

Compass reads hundreds of files into its context, most of them unrelated. It may find the callers, but the context fills and later reasoning about the change degrades.

Check your understanding · explain the design in your own words

A function is used under other names through re-exports. How do you find all its callers?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Built-in tools — the selection criteria (Read, Write, Edit, Bash, Grep, Glob)

Study: Built-in tools — the selection criteria (Read, Write, Edit, Bash, Grep, Glob) Grep Glob

Return to Foundations Mock Exam 2 · Q609's situation and clause-by-clause explanation

D1 · Agentic Architecture

Q610. Compass's documentation writer is meant to update Markdown docs only. Reviews show it sometimes runs Gradle builds through Bash and edits Kotlin source files to 'fix' examples it documents. The explorer and the test writer legitimately need Bash. How should you configure the documentation writer? (Select ONE.) A) Remove Bash from the coordinator's allowedTools list, so that no subagent can run shell commands without first asking for approval. B) Give it an AgentDefinition whose tools list is only Read, Grep, Glob, Write and Edit, with a documentation-only prompt. C) Add a sentence to the documentation writer's prompt saying it must never run builds or change source code under any circumstances. D) Register one PreToolUse hook for the whole agent that denies every Bash call, whichever subagent makes it and whatever the command.

Understand Foundations Mock Exam 2 · Q610 · the situation and each part of the question

The real situation behind this question

Compass's documentation writer was supposed to keep the docs current. Instead, when an example in the docs did not compile, it ran Gradle and changed Kotlin source code, creating surprise diffs in pull requests. Engineers want it to touch documentation only. The explorer and test writer still need shell access for searches and test runs. The architect must restrict one subagent without breaking the other two.

Read the question in parts

Part 1 · edits Kotlin source files to 'fix' examples

the subagent has capabilities beyond its role, which it uses in good faith but wrongly.

Part 2 · meant to update Markdown docs only

the role is narrow and well defined, so its tool set can be narrow too.

What you are being asked to decide

The documentation subagent runs builds and edits code. How do you limit it without limiting the others? Tests using AgentDefinition tool restrictions to scope one subagent's capabilities.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Least-privilege toolinggiving the documentation writer only the file tools that documentation work needs
Agent SDKthe runtime where AgentDefinition sets each subagent's description, prompt and tools

Study: Where agent things live: files vs code Least-privilege tooling Agent SDK

Understand Foundations Mock Exam 2 · Q610's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The restriction must apply to one subagent only. AgentDefinition tool lists scope tools per subagent, so the documentation writer loses Bash while the explorer and test writer keep it.

Connect the design to the situation

A docs writer changes Kotlin source to make an example compile.

Best answer: B. An AgentDefinition gives each subagent its own description, system prompt and tool restriction, so the documentation writer can be limited without affecting others. Removing Bash from allowedTools only removes pre-approval, and it would also hit the subagents that legitimately need Bash.

The decisive evidence in the stem

The explorer and the test writer legitimately need Bash The restriction must apply to one subagent only, which points to that subagent's own definition rather than a global setting.

Official objective tested: Task 1.3 · Configure subagent invocation, context passing, and spawning

What each choice would do here

A · Why this does not meet the full requirement

Remove Bash from the coordinator's allowedTools list, so that no subagent can run shell commands without first asking for approval.

Removes pre-approval for everyone and does not by itself remove the tool from any subagent.

allowedTools controls which tools run without approval; it does not remove tools from subagents. In unattended runs the explorer's Bash calls would be denied, and the docs writer still has Bash available in principle.

B · Why this meets the requirement

Give it an AgentDefinition whose tools list is only Read, Grep, Glob, Write and Edit, with a documentation-only prompt.

Restricts only this subagent's tools, removing Bash from its available set while others keep it.

The documentation writer's AgentDefinition lists Read, Grep, Glob, Write and Edit. Bash is not available to it at all, so it cannot run Gradle. Its prompt says to report broken examples instead of fixing code. The explorer keeps Bash in its own definition.

C · Why this does not meet the full requirement

Add a sentence to the documentation writer's prompt saying it must never run builds or change source code under any circumstances.

Guidance that the subagent has already shown it does not always follow.

The writer follows the sentence most of the time. When a broken example seems to need a fix, it may still decide the edit is helpful, as it already has. Nothing in configuration prevents it.

D · Why this does not meet the full requirement

Register one PreToolUse hook for the whole agent that denies every Bash call, whichever subagent makes it and whatever the command.

Blocks Bash for the explorer and test writer too, breaking their legitimate work.

The documentation writer can no longer run builds, but neither can the test writer run tests, nor the explorer use Bash for searches. The fix breaks two subagents to restrict one.

Check your understanding · explain the design in your own words

The documentation subagent runs builds and edits code. How do you limit it without limiting the others?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Where agent things live: files vs code

Study: Where agent things live: files vs code Least-privilege tooling Agent SDK

Return to Foundations Mock Exam 2 · Q610's situation and clause-by-clause explanation

D1 · Agentic Architecture

Q611. Compass runs nightly maintenance jobs unattended through the Agent SDK. Two problems appear: the coordinator's attempts to spawn subagents are denied in these runs, and in interactive tests where spawning works, the three explorers start one after another, each in a separate coordinator turn. Which TWO changes address these problems? (Select TWO.) A) Add "Task" to the coordinator's allowedTools, so spawning is pre-approved when nobody can answer a permission prompt. B) Have the coordinator fork its own session for each explorer, so each subagent inherits the full coordinator history when it starts. C) List the three explorer names in the project's CLAUDE.md, so the coordinator knows which subagents it is allowed to start. D) Have the coordinator emit all three Task calls in a single response, so the subagents are spawned and run in parallel.

Understand Foundations Mock Exam 2 · Q611 · the situation and each part of the question

The real situation behind this question

Saltmarsh Payments schedules Compass to run maintenance overnight, such as checking for outdated dependencies across modules. At night, the coordinator cannot start any subagents, and the jobs fail. During the day, when engineers test interactively, spawning works but is slow, because the explorers start one at a time. The architect must fix both the nightly failure and the slow sequential spawning.

Read the question in parts

Part 1 · runs nightly maintenance jobs unattended

no person can approve a permission prompt, so tools must be pre-approved in configuration.

Part 2 · each in a separate coordinator turn

spawning across turns forces sequence; parallel spawning needs one response with several calls.

What you are being asked to decide

Subagents are blocked at night and run one by one in tests. Which two settings or behaviours fix that? Tests the Task tool pre-approval requirement and parallel spawning in one response.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Tool availability vs permissionsallowedTools pre-approves tools such as Task so they run without a prompt; it is not a list of what exists
Parallelizationthree explorers started in the same coordinator response so they work at the same time

Study: Sessions, forking, and spawning — the mechanics the exam names Tool availability vs permissions Parallelization

Understand Foundations Mock Exam 2 · Q611's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Unattended runs need Task pre-approved in allowedTools, or every spawn is denied. Parallel subagents need several Task calls in one coordinator response. These are two independent fixes.

Connect the design to the situation

Nightly jobs cannot start subagents, and daytime runs start them sequentially.

Best answer: AD. Spawning uses the Task tool, and in an unattended run a tool that is not pre-approved in allowedTools cannot be approved by anyone, so the call is denied. Parallel subagents come from several Task calls in one coordinator response; separate turns run them in sequence. Forking a session is for exploring alternatives from one baseline, not for spawning workers.

The decisive evidence in the stem

denied in these runs Denials only in unattended runs point to a missing pre-approval, because no person is present to approve the Task tool call.

Official objective tested: Task 1.3 · Configure subagent invocation, context passing, and spawning

What each choice would do here

A · Why this does not meet the full requirement

Add "Task" to the coordinator's allowedTools, so spawning is pre-approved when nobody can answer a permission prompt.

Pre-approves the Task tool, so unattended runs no longer stop at a permission prompt nobody can answer.

With Task in allowedTools, the coordinator's spawn calls run without waiting for approval. The nightly job now starts its explorers. In daytime runs nothing changes except that engineers are no longer asked to approve each spawn.

B · Why this does not meet the full requirement

Have the coordinator fork its own session for each explorer, so each subagent inherits the full coordinator history when it starts.

Forking creates alternative branches of a session; it is not how coordinators spawn workers.

Forking copies one session into a new branch for trying a different approach. It does not create explorer subagents with their own definitions, and copying the full history into each would also waste context.

C · Why this does not meet the full requirement

List the three explorer names in the project's CLAUDE.md, so the coordinator knows which subagents it is allowed to start.

CLAUDE.md gives guidance but does not grant permission for any tool call.

The coordinator reads the names, but the Task call still needs approval in an unattended run. The nightly denial continues, and spawning stays sequential because nothing changed the coordinator's behaviour.

D · Why this does not meet the full requirement

Have the coordinator emit all three Task calls in a single response, so the subagents are spawned and run in parallel.

Several Task calls in one response are what make subagents run in parallel.

The coordinator writes three Task tool calls in the same response: HTTP clients, queue consumers, database access. The SDK runs them concurrently, and the coordinator gets all three results before its next turn.

Walk through complete payloads or code · every step explained

Illustrative examples, not recorded live calls. Check each block's direction and endpoint: API requests, API responses, MCP messages, and configuration files are different contracts.

Coordinator options (illustrative)

PYTHON
options = ClaudeAgentOptions(
    allowed_tools=['Task', 'Read', 'Grep', 'Glob'],
    agents={'explorer': AgentDefinition(
        description='Maps one assigned slice of the codebase',
        prompt='You explore only the slice you are given and report file paths.',
        tools=['Read', 'Grep', 'Glob'])},
)

allowed_tools pre-approves Task for unattended runs; parallelism comes from the coordinator emitting several Task calls in one response.

Which omitted settings use defaults or leave features unconfigured?

Check your understanding · explain the design in your own words

Subagents are blocked at night and run one by one in tests. Which two settings or behaviours fix that?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Sessions, forking, and spawning — the mechanics the exam names

Study: Sessions, forking, and spawning — the mechanics the exam names Tool availability vs permissions Parallelization

Return to Foundations Mock Exam 2 · Q611's situation and clause-by-clause explanation

D5 · Context & Reliability

Q612. Two hours into a session exploring the legacy billing package, Compass starts answering with phrases like 'services like this typically use a repository pattern' instead of naming LedgerRepository and InvoiceStore, which it found and discussed an hour earlier. Its answers about the same classes have also begun to contradict each other. What should you change? (Select ONE.) A) End the session every hour and start a new one with no carried context, so Compass re-explores the package from the beginning each time. B) Switch Compass to a model with a larger context window, so the whole two-hour exploration can stay in context without being degraded. C) Add a system prompt instruction telling Compass always to name specific classes it has found rather than describing typical patterns. D) Have Compass write key findings such as classes, paths and decisions to a scratchpad file, and consult it later.

Understand Foundations Mock Exam 2 · Q612 · the situation and each part of the question

The real situation behind this question

A Saltmarsh Payments engineer has spent two hours with Compass mapping the legacy billing package. Early on, Compass found exactly which classes handle ledger writes. Now it talks about 'typical patterns', and its descriptions of the same classes change from answer to answer. The engineer no longer trusts the session. The architect must keep long explorations reliable. Sessions like this are common.

Read the question in parts

Part 1 · which it found and discussed an hour earlier

the facts were discovered, but the session is no longer using them reliably.

Part 2 · have also begun to contradict each other

inconsistency is a second sign of degraded context, not a knowledge gap.

What you are being asked to decide

After a long session, Compass forgets specific classes and speaks in generalities. How do you keep findings reliable? Tests scratchpad files for persisting key findings against context degradation.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Scratchpada file where Compass writes key findings so it can reread them later
Context windowthe model's working memory for the session, which degrades as exploration output piles up

Study: Scratchpads & crash-recovery manifests Scratchpad Context window

Understand Foundations Mock Exam 2 · Q612's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Generic answers and contradictions show context degradation. Persist key findings in a scratchpad file and read it back for later questions; the facts then survive outside the degrading context.

Connect the design to the situation

Compass says 'a repository pattern' instead of naming LedgerRepository.

Best answer: D. Answers drifting to 'typical patterns' and contradicting earlier findings are signs of context degradation in long sessions. A scratchpad file keeps key findings outside the degrading context, and Compass reads it back when needed. A larger window delays the same degradation without addressing it.

The decisive evidence in the stem

services like this typically use a repository pattern Generic language replacing specific discovered names is the typical sign of context degradation in extended exploration.

Official objective tested: Task 5.4 · Manage context effectively in large codebase exploration

What each choice would do here

A · Why this does not meet the full requirement

End the session every hour and start a new one with no carried context, so Compass re-explores the package from the beginning each time.

Throws away valid findings and repeats exploration every hour.

Every hour Compass loses everything and repeats the same exploration from the start. Engineers spend most of each session waiting for work that was already done once.

B · Why this does not meet the full requirement

Switch Compass to a model with a larger context window, so the whole two-hour exploration can stay in context without being degraded.

Delays degradation but does not stop it in very long sessions.

The bigger window holds more, and the degradation starts later. But long exploration still fills it with verbose output, and the same drift to generic answers returns after a longer session.

C · Why this does not meet the full requirement

Add a system prompt instruction telling Compass always to name specific classes it has found rather than describing typical patterns.

Asks for specifics the model is losing track of; the instruction cannot restore lost details.

Compass tries to comply but cannot reliably name classes it no longer attends to. It may even name plausible but wrong classes, which is worse than a generic answer.

D · Why this meets the requirement

Have Compass write key findings such as classes, paths and decisions to a scratchpad file, and consult it later.

Stores the findings outside the degrading context so Compass can reread exact facts.

Compass keeps billing-findings.md with entries such as 'LedgerRepository: writes ledger rows, called by InvoicePoster' and 'Decision: InvoiceStore is read-only'. When asked later, it reads the file and answers with the exact names, even three hours in.

Check your understanding · explain the design in your own words

After a long session, Compass forgets specific classes and speaks in generalities. How do you keep findings reliable?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Scratchpads & crash-recovery manifests

Study: Scratchpads & crash-recovery manifests Scratchpad Context window

Return to Foundations Mock Exam 2 · Q612's situation and clause-by-clause explanation

D2 · Claude Code

Q613. Saltmarsh Payments engineers use a project skill, /map-module, in Claude Code to analyze a module before changing it. The skill reads dozens of files and prints about 3,000 lines of analysis into the conversation. After running it, engineers find their session sluggish and Claude losing track of the change they were planning. What should change in the skill? (Select ONE.) A) Add context: fork to the SKILL.md frontmatter, so the analysis runs in an isolated subagent context and returns only its result to the main session. B) Add an argument-hint to the SKILL.md frontmatter, so engineers are reminded to name a smaller module when they invoke the skill. C) Move the skill's instructions into the project CLAUDE.md, so the analysis guidance is always loaded and the skill is no longer needed. D) Add allowed-tools: Read to the SKILL.md frontmatter, so the skill can only read files during its run and produces less output.

Understand Foundations Mock Exam 2 · Q613 · the situation and each part of the question

The real situation behind this question

Engineers at Saltmarsh Payments like /map-module because it gives a thorough picture of a module. But it prints thousands of lines into the conversation. After running it, their Claude Code session becomes slow, and Claude forgets details of the change the engineer described just before. The team wants the analysis without polluting the session where the actual work happens. Speed matters to them.

Read the question in parts

Part 1 · Claude losing track of the change they were planning

the verbose output crowds out the important context of the main task.

Part 2 · a project skill, /map-module

the fix belongs in the skill's own configuration, shared with the team.

What you are being asked to decide

A skill dumps huge output into the session. How do you keep the session clean? Tests context: fork to isolate a verbose skill from the main conversation.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Skillthe /map-module procedure stored in .claude/skills/ and invoked on demand
Frontmatterthe YAML header in SKILL.md where options such as context: fork are set

Study: Skills vs slash commands vs subagents — the discriminator Skill Frontmatter

Understand Foundations Mock Exam 2 · Q613's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The skill's verbose output crowds the main session. context: fork runs it in an isolated subagent context and returns only the summary. argument-hint and allowed-tools do not isolate output.

Connect the design to the situation

A module analysis floods the session with 3,000 lines.

Best answer: A. context: fork runs the skill in a separate subagent context, so its verbose reading and analysis stay out of the main conversation. argument-hint only shows a hint for the argument; it does not reduce how much output lands in the session.

The decisive evidence in the stem

prints about 3,000 lines of analysis into the conversation The problem is verbose output polluting the main session, which is what forked skill execution isolates.

Official objective tested: Task 3.2 · Create and configure custom slash commands and skills

What each choice would do here

A · Why this meets the requirement

Add context: fork to the SKILL.md frontmatter, so the analysis runs in an isolated subagent context and returns only its result to the main session.

Keeps the verbose work in a separate context and returns only the useful result.

With context: fork, the skill runs in its own subagent context. It reads the files and writes the analysis there, and the main session receives a short summary of the module's structure and risks. The engineer's plan stays in focus.

B · Why this does not meet the full requirement

Add an argument-hint to the SKILL.md frontmatter, so engineers are reminded to name a smaller module when they invoke the skill.

A hint for the argument does not change how much output the analysis produces.

Engineers see '<module-path>' as a hint, but they still analyze full modules, and the 3,000 lines still land in the session. argument-hint guides input; it does not isolate output.

C · Why this does not meet the full requirement

Move the skill's instructions into the project CLAUDE.md, so the analysis guidance is always loaded and the skill is no longer needed.

Loads analysis guidance into every session and still runs the analysis in the main context.

Every session now loads the analysis instructions, even for unrelated work, and running the analysis still produces the same verbose output in the main context.

D · Why this does not meet the full requirement

Add allowed-tools: Read to the SKILL.md frontmatter, so the skill can only read files during its run and produces less output.

Pre-approving Read does not shrink the analysis output that lands in the session.

The skill already mostly reads files. Pre-approving Read changes which tool calls need approval, not how much analysis text is printed into the main conversation after each run.

Walk through complete payloads or code · every step explained

Illustrative examples, not recorded live calls. Check each block's direction and endpoint: API requests, API responses, MCP messages, and configuration files are different contracts.

SKILL.md frontmatter (illustrative)

YAML
---
name: map-module
description: Analyze a module's structure, dependencies and risks before a change
context: fork
argument-hint: <module-path>
---
Read the module, map its public API and callers, and return a summary under 40 lines.

context: fork moves the run into a separate subagent context; the main session gets only the returned summary.

Which omitted settings use defaults or leave features unconfigured?

Check your understanding · explain the design in your own words

A skill dumps huge output into the session. How do you keep the session clean?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Skills vs slash commands vs subagents — the discriminator

Study: Skills vs slash commands vs subagents — the discriminator Skill Frontmatter

Return to Foundations Mock Exam 2 · Q613's situation and clause-by-clause explanation

D1 · Agentic Architecture

Q614. Compass has Bash so it can run tests and builds. Its system prompt forbids force-pushing, deleting branches and running database migrations against shared environments. Last week an Compass session ran a migration script against the shared staging database, which took the staging environment down for three hours. How should you prevent this class of command? (Select ONE.) A) Remove Bash from Compass's tools entirely, so it can only read and edit files and never execute any command on a machine. B) Leave Bash out of allowedTools, so each Bash command waits for permission and is denied when no person is present to approve it. C) Add a PreToolUse hook on Bash that inspects each command, denies the forbidden patterns with a reason, and allows the rest. D) Repeat the forbidden actions at the top and bottom of the system prompt and add examples of refusing dangerous commands that users request.

Understand Foundations Mock Exam 2 · Q614 · the situation and each part of the question

The real situation behind this question

Compass runs tests and builds through Bash, which is central to its value. The team wrote clear prompt rules against dangerous commands. Still, during one investigation, Compass decided that running a migration script would help reproduce a bug, and it ran it against shared staging. Staging was down for three hours. The team must stop such commands without losing Bash.

Read the question in parts

Part 1 · took the staging environment down for three hours

the cost of one failure is high, which justifies deterministic enforcement.

Part 2 · Compass has Bash so it can run tests and builds

Bash is needed, so the fix must restrict commands, not remove the tool.

What you are being asked to decide

The prompt forbids dangerous commands, but Compass ran one anyway. How do you stop it for sure while keeping Bash? Tests a tool-call interception hook for guaranteed compliance over prompt guidance.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Hookcode the Agent SDK runs before each Bash call, which can deny it
Guardrailthe enforced limit on which shell commands Compass may run

Study: Agent SDK hooks: block a call, clean up a result Hook Guardrail

Understand Foundations Mock Exam 2 · Q614's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The prompt rule already failed once, and the cost was high. A PreToolUse hook on Bash denies the forbidden patterns every time, while the commands Compass needs still run.

Connect the design to the situation

A migration run against shared staging takes it down for three hours.

Best answer: C. When a rule must always hold, a hook that intercepts the outgoing tool call enforces it in code, regardless of what the model decides. The prompt was already explicit and still failed once with costly results. Removing Bash stops the problem but also stops the test and build work Compass exists to do.

The decisive evidence in the stem

Its system prompt forbids force-pushing, deleting branches and running database migrations The rule was already stated in the prompt and was still broken, so guidance is not enough and code enforcement is needed.

Official objective tested: Task 1.5 · Apply Agent SDK hooks for tool call interception and data normalization

What each choice would do here

A · Why this does not meet the full requirement

Remove Bash from Compass's tools entirely, so it can only read and edit files and never execute any command on a machine.

Safe, but removes the test and build capability Compass needs.

Compass can no longer run a single test, build a module or reproduce a bug. The danger is gone, and so is most of its usefulness to engineers.

B · Why this does not meet the full requirement

Leave Bash out of allowedTools, so each Bash command waits for permission and is denied when no person is present to approve it.

Blocks all Bash in unattended runs and depends on human approval in interactive ones.

Nightly jobs cannot run tests at all, because nobody approves Bash. In interactive sessions an engineer approving quickly can still approve the migration. Safety depends on a person reading every command.

C · Why this meets the requirement

Add a PreToolUse hook on Bash that inspects each command, denies the forbidden patterns with a reason, and allows the rest.

Blocks the dangerous patterns every time while keeping tests and builds working.

The hook sees 'flyway migrate -url=jdbc:…staging…' and returns deny with 'Migrations against shared environments are not allowed; run against the local container'. Compass adapts and uses the local database. './gradlew test' passes through unchanged.

D · Why this does not meet the full requirement

Repeat the forbidden actions at the top and bottom of the system prompt and add examples of refusing dangerous commands that users request.

More guidance for a rule that guidance already failed to enforce.

The prompt gets longer and Compass follows it most of the time. In an unusual investigation it may again decide a migration is the helpful step. A rule that already failed once is still only guidance.

Walk through complete payloads or code · every step explained

Illustrative examples, not recorded live calls. Check each block's direction and endpoint: API requests, API responses, MCP messages, and configuration files are different contracts.

PreToolUse hook for forbidden Bash patterns (illustrative)

PYTHON
import re
FORBIDDEN = [r'git push .*--force', r'git branch -D', r'flyway migrate .*(staging|prod)']

async def guard_bash(input_data, tool_use_id, context):
    cmd = input_data['tool_input'].get('command', '')
    if any(re.search(p, cmd) for p in FORBIDDEN):
        return {'hookSpecificOutput': {
            'hookEventName': 'PreToolUse',
            'permissionDecision': 'deny',
            'permissionDecisionReason': 'Blocked by policy: use the local environment instead.'}}
    return {}

The hook runs before every Bash call; only matching commands are denied, so normal test and build commands keep working.

Which omitted settings use defaults or leave features unconfigured?

Check your understanding · explain the design in your own words

The prompt forbids dangerous commands, but Compass ran one anyway. How do you stop it for sure while keeping Bash?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Agent SDK hooks: block a call, clean up a result

Study: Agent SDK hooks: block a call, clean up a result Hook Guardrail

Return to Foundations Mock Exam 2 · Q614's situation and clause-by-clause explanation

D1 · Agentic Architecture

Q615. Compass's coordinator sends every request through the full pipeline: the explorer maps the code, the test writer drafts tests, and the documentation writer updates docs. A question such as 'what does LedgerPoster.flush() return?' takes four minutes and produces unwanted test files. Engineers have stopped using Compass for quick questions. What should change in the coordinator? (Select ONE.) A) Keep the full pipeline but instruct the test and documentation writers to produce no output when the request does not need it. B) Remove the coordinator and let engineers pick which subagent to call directly by typing its name at the start of each request. C) Run the three subagents in parallel instead of in sequence, so the full pipeline finishes in about one third of the time. D) Have the coordinator analyze each request and invoke only the subagents that the request actually needs.

Understand Foundations Mock Exam 2 · Q615 · the situation and each part of the question

The real situation behind this question

Compass was designed for big tasks such as 'add a new endpoint with tests and docs', so its coordinator always runs the explorer, the test writer and the documentation writer. Engineers also want fast answers to small questions, but each small question takes minutes and leaves stray test files behind. Usage for quick questions has dropped. The architect needs the coordinator to fit the work to the request.

Read the question in parts

Part 1 · produces unwanted test files

the full pipeline does not just waste time; it creates side effects nobody requested.

Part 2 · Engineers have stopped using Compass for quick questions

the cost of the fixed pipeline is now lost adoption, a real product problem.

What you are being asked to decide

Every question runs all three subagents, even simple ones. What should the coordinator do instead? Tests a coordinator that selects subagents by request complexity rather than always running the full pipeline.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Orchestratorthe coordinator agent that decides which subagents each request needs
Subagentthe explorer, test writer or documentation writer, each with its own context

Study: Orchestrator, worker, agent, and thread are different ideas Orchestrator Subagent

Understand Foundations Mock Exam 2 · Q615's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Routing every request through all subagents wastes time and creates side effects. The coordinator should analyze each request and invoke only the subagents it needs.

Connect the design to the situation

A one-line question about a return value triggers test and doc generation.

Best answer: D. A coordinator should select subagents dynamically based on what the request requires, not route everything through the full pipeline. A simple question needs only the explorer. Running all three in parallel shortens the wait but still writes unwanted tests and wastes work.

The decisive evidence in the stem

sends every request through the full pipeline The coordinator is not deciding which subagents a request needs, so simple questions pay for work they never asked for.

Official objective tested: Task 1.2 · Orchestrate multi-agent systems with coordinator-subagent patterns

What each choice would do here

A · Why this does not meet the full requirement

Keep the full pipeline but instruct the test and documentation writers to produce no output when the request does not need it.

Still invokes every subagent and relies on each one deciding to do nothing.

Each subagent still starts, loads context and reasons about whether to act, costing time and tokens. Some will still decide to write something, because the instruction is a judgment call.

B · Why this does not meet the full requirement

Remove the coordinator and let engineers pick which subagent to call directly by typing its name at the start of each request.

Moves the coordinator's job to engineers and loses coordination for multi-step requests.

Engineers must learn the subagent names and decide routing themselves. Multi-step requests lose the coordinator that passes the explorer's findings to the test writer, so complex tasks get worse.

C · Why this does not meet the full requirement

Run the three subagents in parallel instead of in sequence, so the full pipeline finishes in about one third of the time.

Faster, but still runs work nobody asked for and still creates test files.

The question now takes about ninety seconds, but the test writer still creates a test file for LedgerPoster and the documentation writer still edits docs. Engineers still clean up output they did not want.

D · Why this meets the requirement

Have the coordinator analyze each request and invoke only the subagents that the request actually needs.

Matches the work to the request, so quick questions stay quick and produce no side effects.

For 'what does flush() return?', the coordinator calls only the explorer, which reads the method and answers in twenty seconds. For 'add an endpoint with tests', it still calls all three. The coordinator's routing decision is the change.

Check your understanding · explain the design in your own words

Every question runs all three subagents, even simple ones. What should the coordinator do instead?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Orchestrator, worker, agent, and thread are different ideas

Study: Orchestrator, worker, agent, and thread are different ideas Orchestrator Subagent

Return to Foundations Mock Exam 2 · Q615's situation and clause-by-clause explanation

D4 · Tools & MCP

Q616. Compass must change the retry timeout for only the 'settlement' client in a YAML config file. The Edit tool fails repeatedly because the text 'timeout: 30s' appears four times in the file, once for each client, and Compass keeps retrying the same Edit call. What should Compass do to make the change reliably? (Select ONE.) A) Run Edit with replace_all enabled, so that every 'timeout: 30s' in the file is updated and the non-unique match error disappears. B) Write a new version of the file from memory with the corrected timeout, without reading the current file first, to save a step. C) Read the full file, change the timeout inside the settlement block only, and Write the complete updated file back. D) Use Bash to run a sed command that replaces the first 'timeout: 30s' it finds, assuming the settlement client appears first.

Understand Foundations Mock Exam 2 · Q616 · the situation and each part of the question

The real situation behind this question

A Saltmarsh Payments engineer asks Compass to raise the retry timeout for the settlement client only. The config file has four client blocks, each with the same 'timeout: 30s' line. Compass's Edit call fails because the text is not unique, and Compass keeps retrying the same call. The engineer wants the single change made safely, without touching the other clients.

Read the question in parts

Part 1 · for only the 'settlement' client

the change must touch one block and leave the other three unchanged.

Part 2 · Compass keeps retrying the same Edit call

repeating a call that cannot succeed wastes turns; a different method is needed.

What you are being asked to decide

Edit fails because the text appears four times. How does Compass change only one? Tests using Read plus Write as the fallback when Edit cannot find unique anchor text.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Editthe tool that replaces one unique piece of text and fails when the text repeats
Writethe tool that saves a whole file, used after Read to apply the targeted change

Study: Built-in tools — the selection criteria (Read, Write, Edit, Bash, Grep, Glob) Edit Read Write

Understand Foundations Mock Exam 2 · Q616's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Edit needs a unique anchor, and this one repeats. Read the whole file, change only the settlement block, and Write it back. That is the reliable fallback.

Connect the design to the situation

Four clients share 'timeout: 30s'; only the settlement client should change.

Best answer: C. Edit needs unique anchor text; when the text repeats, reading the whole file and writing it back with the targeted change is a reliable fallback. replace_all changes all four clients instead of one, and sed on the first match relies on an assumption about file order.

The decisive evidence in the stem

the text 'timeout: 30s' appears four times The anchor is not unique, so Edit cannot work as called and a full read-then-write is needed.

Official objective tested: Task 2.5 · Select and apply built-in tools (Read, Write, Edit, Bash, Grep, Glob) effectively

What each choice would do here

A · Why this does not meet the full requirement

Run Edit with replace_all enabled, so that every 'timeout: 30s' in the file is updated and the non-unique match error disappears.

Changes all four clients, which is not the requested change.

All four clients now have the new timeout. The payouts and refunds clients behave differently in production, although nobody asked for that change and nobody reviews it as intended.

B · Why this does not meet the full requirement

Write a new version of the file from memory with the corrected timeout, without reading the current file first, to save a step.

Writing without reading risks losing other content Compass does not remember exactly.

Compass reconstructs the file from its memory of a partial view. Comments, ordering or another client's settings come out slightly different, creating changes no one intended.

C · Why this meets the requirement

Read the full file, change the timeout inside the settlement block only, and Write the complete updated file back.

Loads the real content, changes only the settlement block, and saves the whole file.

Compass reads the file, finds the settlement block, changes its timeout to 60s, and writes the file back with all other content as read. The other three clients keep 30s, and the diff shows exactly one changed line.

D · Why this does not meet the full requirement

Use Bash to run a sed command that replaces the first 'timeout: 30s' it finds, assuming the settlement client appears first.

Depends on the order of blocks and edits the wrong client if settlement is not first.

If the file lists 'payouts' first, sed changes the payouts timeout instead. The settlement client stays at 30s, and the wrong client changes silently without any error message.

Check your understanding · explain the design in your own words

Edit fails because the text appears four times. How does Compass change only one?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Built-in tools — the selection criteria (Read, Write, Edit, Bash, Grep, Glob)

Study: Built-in tools — the selection criteria (Read, Write, Edit, Bash, Grep, Glob) Edit Read Write

Return to Foundations Mock Exam 2 · Q616's situation and clause-by-clause explanation

D1 · Agentic Architecture

Q617. The explorer reports that the refunds module uses a FakeClock fixture, a LedgerTestHarness for database state, and a strict rule against mocking the payments gateway. The coordinator then spawns the test writer with the Task prompt 'Write unit tests for the refunds module.' The tests use real clocks and mock the gateway. What should change? (Select ONE.) A) Include the explorer's complete findings in the test writer's Task prompt: fixtures, the harness, the no-mocking rule, file paths. B) Configure the test writer to inherit the coordinator's conversation history, so it can read the explorer's report from earlier in the session. C) Give the test writer access to the explorer's tools so it can call the explorer subagent directly whenever it needs project context. D) Tell the test writer in its system prompt to explore the refunds module again on its own before writing any tests for the module.

Understand Foundations Mock Exam 2 · Q617 · the situation and each part of the question

The real situation behind this question

Compass's explorer did good work on the refunds module and found exactly how its tests must be written. But the coordinator passed the test writer only a one-line instruction. The test writer, starting with no context, wrote ordinary tests with real clocks and a mocked gateway, which the team's rules forbid. The architect must make the explorer's findings reach the test writer.

Read the question in parts

Part 1 · a strict rule against mocking the payments gateway

a project-specific rule that the test writer cannot guess and must be told.

Part 2 · The tests use real clocks and mock the gateway

the failure is exactly what you expect when a subagent writes tests with no project context.

What you are being asked to decide

The explorer found the right fixtures, but the test writer never saw them. How do you pass the findings? Tests passing prior agents' complete findings explicitly in the subagent's prompt.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Context isolationthe test writer starts with an empty context and sees only its Task prompt
Subagent handoffthe coordinator writing the explorer's findings into the next subagent's prompt

Study: Coordinator handoffs: wait, pass context, then continue Context isolation Subagent handoff

Understand Foundations Mock Exam 2 · Q617's answer · full reasoning and worked examples
Claude synthesized · the point, straight

A subagent sees only its prompt. The explorer's fixtures and rules must be written into the test writer's Task prompt, or the test writer works without them.

Connect the design to the situation

Tests use a real clock and mock the gateway although the explorer documented the rules.

Best answer: A. Subagents do not inherit the coordinator's context; they know only what their prompt contains. Passing the explorer's findings directly in the Task prompt gives the test writer the fixtures and rules it must follow. Re-exploring wastes the work already done and may reach different conclusions.

The decisive evidence in the stem

with the Task prompt 'Write unit tests for the refunds module.' The prompt carries none of the explorer's findings, and the subagent cannot see them any other way, so it writes generic tests.

Official objective tested: Task 1.3 · Configure subagent invocation, context passing, and spawning

What each choice would do here

A · Why this meets the requirement

Include the explorer's complete findings in the test writer's Task prompt: fixtures, the harness, the no-mocking rule, file paths.

Puts the needed facts where the subagent can actually see them: its prompt.

The Task prompt now lists 'Use FakeClock from test/support/clock.kt; set database state with LedgerTestHarness; never mock PaymentsGateway, use the sandbox stub'. The test writer follows each rule, and the tests pass review on the first try.

B · Why this does not meet the full requirement

Configure the test writer to inherit the coordinator's conversation history, so it can read the explorer's report from earlier in the session.

Subagents do not inherit the coordinator's conversation, so this is not how context reaches them.

There is no setting that makes a Task subagent read the coordinator's history automatically. The test writer still starts empty, and the tests still ignore the fixtures.

C · Why this does not meet the full requirement

Give the test writer access to the explorer's tools so it can call the explorer subagent directly whenever it needs project context.

Creates subagent-to-subagent calls and still does not hand over the findings already gathered.

The test writer now spends turns calling the explorer instead of testing, and the coordinator loses control of the flow. The findings already in hand are still not passed.

D · Why this does not meet the full requirement

Tell the test writer in its system prompt to explore the refunds module again on its own before writing any tests for the module.

Repeats work already done and may find different or fewer conventions.

The test writer spends tokens and time re-reading the module. It may find FakeClock but miss the no-mocking rule, which lives in a review note the explorer had found.

Walk through complete payloads or code · every step explained

Illustrative examples, not recorded live calls. Check each block's direction and endpoint: API requests, API responses, MCP messages, and configuration files are different contracts.

Task prompt with the explorer's findings (illustrative)

TEXT
Goal: unit tests for refunds/ that pass review.
Findings from the explorer:
- Time: use FakeClock (test/support/clock.kt), never Instant.now()
- DB state: LedgerTestHarness.seed(...)
- Rule: never mock PaymentsGateway; use GatewaySandboxStub
- Files: refunds/RefundService.kt, refunds/RefundPolicy.kt
Quality bar: each public method has a happy path and one failure path.

The coordinator writes the explorer's results into the prompt; that is the only context the test writer receives.

Which omitted settings use defaults or leave features unconfigured?

Check your understanding · explain the design in your own words

The explorer found the right fixtures, but the test writer never saw them. How do you pass the findings?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Coordinator handoffs: wait, pass context, then continue

Study: Coordinator handoffs: wait, pass context, then continue Context isolation Subagent handoff

Return to Foundations Mock Exam 2 · Q617's situation and clause-by-clause explanation

D1 · Agentic Architecture

Q618. An engineer spent 40 minutes with Compass analyzing the build setup of 900 modules in a named session called 'build-audit'. Now the team wants to compare two migration strategies: moving to a Gradle version catalog, or keeping buildSrc with convention plugins. Each strategy needs its own exploration, and neither should affect the other or the original analysis. Which approach fits? (Select ONE.) A) Resume 'build-audit' and ask Compass to explore both strategies at once, alternating between them in the same conversation. B) Fork the 'build-audit' session twice with fork_session, exploring one strategy in each branch from the same baseline analysis. C) Start two new sessions with no prior context and repeat the 40-minute build analysis in each before exploring one strategy per session. D) Resume 'build-audit', explore the version catalog strategy, then tell Compass to forget that work and explore the buildSrc strategy next.

Understand Foundations Mock Exam 2 · Q618 · the situation and each part of the question

The real situation behind this question

A Saltmarsh Payments engineer and Compass spent forty minutes building a detailed picture of how 900 modules are built. The team now wants to judge two different migration strategies fairly. Each needs exploration that builds on the shared analysis, and the team does not want work on one strategy to colour the other, or to change the saved analysis they may need again.

Read the question in parts

Part 1 · in a named session called 'build-audit'

the analysis is saved under a name, so it can serve as a reusable baseline.

Part 2 · Each strategy needs its own exploration

the two paths diverge after the shared analysis, which is the case forking is designed for.

What you are being asked to decide

Two strategies should start from the same 40-minute analysis without mixing. Resume, fork or start over? Tests fork_session for parallel exploration branches from a shared analysis baseline.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Checkpointthe saved 'build-audit' session that both branches start from
Context isolationeach branch keeps its own reasoning, so one strategy does not bias the other

Study: Named sessions: resume, continue, fork, or start fresh Checkpoint Context isolation

Understand Foundations Mock Exam 2 · Q618's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Two independent paths need the same starting analysis. fork_session gives each strategy its own branch from 'build-audit', with no cross-contamination and no repeated work.

Connect the design to the situation

Comparing a version catalog against convention plugins after one shared build audit.

Best answer: B. fork_session creates independent branches from a shared baseline, so each strategy builds on the full analysis without contaminating the other or the original session. Exploring both in one resumed session mixes the reasoning, and an instruction to forget cannot remove what is already in context.

The decisive evidence in the stem

neither should affect the other or the original analysis Independent exploration from one shared starting point, with no effect on the baseline, is exactly what forking a session provides.

Official objective tested: Task 1.7 · Manage session state, resumption, and forking

What each choice would do here

A · Why this does not meet the full requirement

Resume 'build-audit' and ask Compass to explore both strategies at once, alternating between them in the same conversation.

Mixes both explorations in one context, making comparisons muddled.

Compass switches back and forth, and findings for one strategy leak into conclusions about the other. The engineer struggles to separate which conflict belongs to which approach.

B · Why this meets the requirement

Fork the 'build-audit' session twice with fork_session, exploring one strategy in each branch from the same baseline analysis.

Reuses the analysis and keeps the two explorations and the original separate.

The team runs two forks from 'build-audit'. One explores the version catalog and finds three plugins that conflict. The other explores convention plugins. Both use the full analysis, neither sees the other's reasoning, and 'build-audit' stays unchanged.

C · Why this does not meet the full requirement

Start two new sessions with no prior context and repeat the 40-minute build analysis in each before exploring one strategy per session.

Throws away a valid 40-minute analysis and repeats it twice.

Each new session spends forty minutes rebuilding the same picture of the build, and the two analyses may differ in details, making the comparison less fair.

D · Why this does not meet the full requirement

Resume 'build-audit', explore the version catalog strategy, then tell Compass to forget that work and explore the buildSrc strategy next.

The first strategy's reasoning stays in context and biases the second.

After exploring the catalog, Compass is told to forget it, but the reasoning is still in the context. Its buildSrc analysis keeps comparing to the catalog, and the saved session now holds both explorations.

Check your understanding · explain the design in your own words

Two strategies should start from the same 40-minute analysis without mixing. Resume, fork or start over?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Named sessions: resume, continue, fork, or start fresh

Study: Named sessions: resume, continue, fork, or start fresh Checkpoint Context isolation

Return to Foundations Mock Exam 2 · Q618's situation and clause-by-clause explanation

Scenario 3 · Claude Code for Continuous Integration

D2 · Claude Code

Q619. The team created .claude/rules/api-handlers.md with paths: ["src/api/.ts"] to load error-handling conventions for API handlers. The rule loads when Claude edits src/api/router.ts, but not when it edits handlers in src/api/v2/payments/refund.ts, where most handlers live. What change fixes this? (Select ONE.) A) Add a CLAUDE.md inside src/api/v2/payments/ that repeats the error-handling conventions for the handlers in that one directory. B) Change the glob to src/api/**/.ts, so the rule matches handler files at any depth below src/api. C) Rename the rule file to api-handlers-v2.md, so Claude Code associates it with the v2 directory where most handlers are stored. D) Move the conventions into the root CLAUDE.md, so they load in every session whether or not Claude is editing API handler files.

Understand Foundations Mock Exam 2 · Q619 · the situation and each part of the question

The real situation behind this question

Lumen Ledger added a path-scoped rule so API error-handling conventions load only for handler files. It seemed to work in a quick test on the router file. But most handlers live several folders deeper, and there Claude ignores the conventions. The team needs to understand why the rule does not load and fix it without losing the path scoping. Consistency across handlers matters.

Read the question in parts

Part 1 · where most handlers live

the files that matter most are exactly the ones the current glob misses.

Part 2 · The rule loads when Claude edits src/api/router.ts

the path-scoping mechanism works; the glob pattern is simply too narrow.

What you are being asked to decide

A path rule loads for top-level files but not nested ones. What is wrong? Tests writing glob patterns in path-specific rules that match files at any depth.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Frontmatterthe YAML header in the rule file where the paths list sits
YAMLthe format of that header; the glob inside it decides which files trigger the rule

Study: .claude/rules/ — path-scoped conventions with glob frontmatter Frontmatter YAML

Understand Foundations Mock Exam 2 · Q619's answer · full reasoning and worked examples
Claude synthesized · the point, straight

A single * matches one directory level, so nested handlers never match. Use src/api/**/*.ts to match every depth while keeping the rule scoped to API files.

Connect the design to the situation

src/api/router.ts loads the rule, src/api/v2/payments/refund.ts does not.

Best answer: B. A single * matches files in one directory level only, so the pattern never matches nested handler files. A recursive ** glob matches every depth. Moving the conventions to the root CLAUDE.md makes them load everywhere, which wastes context.

The decisive evidence in the stem

paths: ["src/api/*.ts"] This glob matches only files directly in src/api, so deeper handler files never trigger the rule.

Official objective tested: Task 3.3 · Apply path-specific rules for conditional convention loading

What each choice would do here

A · Why this does not meet the full requirement

Add a CLAUDE.md inside src/api/v2/payments/ that repeats the error-handling conventions for the handlers in that one directory.

Covers one directory and duplicates the conventions.

Handlers in v2/payments are covered, but v2/payouts and v3 are not. The conventions now exist in two places and will drift as soon as one is edited.

B · Why this meets the requirement

Change the glob to src/api/**/*.ts, so the rule matches handler files at any depth below src/api.

Fixes the pattern so nested handler files match.

With paths: ["src/api/**/*.ts"], the rule matches router.ts and v2/payments/refund.ts alike. Claude now applies the error-handling conventions to every handler, and files outside src/api still do not load them.

C · Why this does not meet the full requirement

Rename the rule file to api-handlers-v2.md, so Claude Code associates it with the v2 directory where most handlers are stored.

The file name does not control matching; the paths glob does.

The name changes, but the paths field still says src/api/*.ts. Nested handlers still do not match, and the problem stays exactly the same. Renaming fixes nothing.

D · Why this does not meet the full requirement

Move the conventions into the root CLAUDE.md, so they load in every session whether or not Claude is editing API handler files.

Loads the conventions everywhere instead of fixing the scope.

The conventions now load for every task, including frontend work and CI reviews of documentation. The handlers are covered, but the team has lost the path scoping it wanted.

Check your understanding · explain the design in your own words

A path rule loads for top-level files but not nested ones. What is wrong?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: .claude/rules/ — path-scoped conventions with glob frontmatter

Study: .claude/rules/ — path-scoped conventions with glob frontmatter Frontmatter YAML

Return to Foundations Mock Exam 2 · Q619's situation and clause-by-clause explanation

D2 · Claude Code

Q620. The test-generation job produces many tests that developers delete: about a third duplicate scenarios already covered in existing test files, and many others only check getters and setters. Developers also complain that generated tests build their own database setup instead of using the team's shared fixtures. What change would most improve the generated tests? (Select ONE.) A) Generate three times as many tests on each run, then keep only those that pass and increase coverage the most, discarding all of the others. B) Document testing standards, what makes a test valuable, and the available fixtures in CLAUDE.md, and include the module's existing test files in the job's context. C) Move the test-generation job to the Message Batches API overnight, so the extra time lets Claude write more careful and thorough tests. D) Filter the generated tests after each run by comparing test names with existing ones, and delete any generated test with a similar name.

Understand Foundations Mock Exam 2 · Q620 · the situation and each part of the question

The real situation behind this question

Lumen Ledger's test-generation job was meant to save developers time. Instead, developers delete many of its tests: some repeat existing scenarios, some test trivial getters, and many set up databases by hand instead of using the shared fixtures. The platform team wants generated tests that developers keep, with less cleanup on every pull request. Cleanup currently costs more time than the job saves.

Read the question in parts

Part 1 · many others only check getters and setters

Claude lacks criteria for what makes a test valuable to this team.

Part 2 · build their own database setup instead of using the team's shared fixtures

Claude does not know the fixtures exist, which documentation fixes.

What you are being asked to decide

Generated tests duplicate old ones, test trivial code and ignore fixtures. What fixes that? Tests providing standards, fixtures and existing tests as context for CI test generation.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
CLAUDE.mdthe project file the CI job loads, where testing standards and fixtures are documented
Headlessthe CI run of Claude Code with -p, which sees only what the job and project provide

Study: Claude Code in CI/CD (scenario 5 — CI/CD automation — territory) CLAUDE.md Headless

Understand Foundations Mock Exam 2 · Q620's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Claude cannot follow standards it was never given or avoid tests it cannot see. Document standards and fixtures in CLAUDE.md and include existing tests in the job's context.

Connect the design to the situation

Generated tests recreate database setup and re-test scenarios already covered.

Best answer: B. CLAUDE.md is how CI-invoked Claude Code gets project context such as testing standards and fixtures, and including existing tests lets it avoid duplicate scenarios. Name-based filtering after the fact misses duplicates with different names and does nothing about getter tests or fixtures.

The decisive evidence in the stem

duplicate scenarios already covered in existing test files Claude cannot avoid what it cannot see, so the existing tests must be in the job's context.

Official objective tested: Task 3.6 · Integrate Claude Code into CI/CD pipelines

What each choice would do here

A · Why this does not meet the full requirement

Generate three times as many tests on each run, then keep only those that pass and increase coverage the most, discarding all of the others.

Generates more of the same low-value tests and ranks them by coverage, not value.

Claude writes ninety tests, many of them getters and duplicates. Coverage ranking favours tests that execute many trivial lines, so the kept tests are still low value.

B · Why this meets the requirement

Document testing standards, what makes a test valuable, and the available fixtures in CLAUDE.md, and include the module's existing test files in the job's context.

Gives Claude the standards, fixtures and existing coverage it needs to write useful new tests.

CLAUDE.md now says 'Test behaviour and failure paths, not accessors; use LedgerFixtures.seed() for database state'. The job also adds the module's existing tests to the context. New tests target uncovered failure paths and use the shared fixtures.

C · Why this does not meet the full requirement

Move the test-generation job to the Message Batches API overnight, so the extra time lets Claude write more careful and thorough tests.

Time is not the limit; missing context is, and batch adds delay.

The tests arrive the next morning instead of during the pull request. Claude still lacks the standards, fixtures and existing tests, so the same problems appear later.

D · Why this does not meet the full requirement

Filter the generated tests after each run by comparing test names with existing ones, and delete any generated test with a similar name.

Catches only duplicates with similar names and ignores the fixture and getter problems.

A duplicate named test_refund_rejects_old_order passes the filter because the existing test is named test_old_order_refund_denied. Getter tests and hand-built setups remain. The filter treats a symptom, not the missing context.

Check your understanding · explain the design in your own words

Generated tests duplicate old ones, test trivial code and ignore fixtures. What fixes that?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Claude Code in CI/CD (scenario 5 — CI/CD automation — territory)

Study: Claude Code in CI/CD (scenario 5 — CI/CD automation — territory) CLAUDE.md Headless

Return to Foundations Mock Exam 2 · Q620's situation and clause-by-clause explanation

D1 · Agentic Architecture

Q621. Lumen Ledger's review job checks the same aspects on every pull request in the same order: security, public API compatibility, database migration safety, then a short summary. A teammate proposes replacing it with an autonomous agent that plans its own investigation steps for each pull request. Reviews must stay consistent and auditable across 300 pull requests a week. Which decomposition should the job use? (Select ONE.) A) Four independent agents that each review one aspect and post their own comments directly, with no summary step joining their results. B) An autonomous agent that decides for each pull request which aspects to check and in what order, based on what it discovers in the diff. C) A fixed prompt chain with one focused step per aspect and a final summary step, keeping dynamic planning for open-ended jobs such as flaky-test investigations. D) One combined prompt that asks Claude to check security, compatibility and migrations together and then write the summary in the same response.

Understand Foundations Mock Exam 2 · Q621 · the situation and each part of the question

The real situation behind this question

Lumen Ledger's platform team runs the same review checklist on every pull request: security first, then API compatibility, then migration safety, then a summary. A teammate likes the idea of an agent that decides for itself what to check. But auditors and developers rely on every pull request getting the same checks. The architect must choose how this review should be structured.

Read the question in parts

Part 1 · plans its own investigation steps for each pull request

adaptive planning is useful when steps are unknown, which is not the case here.

Part 2 · consistent and auditable

every pull request must get the same checks, which a fixed chain guarantees.

What you are being asked to decide

The review always checks the same things in the same order. Fixed chain or self-planning agent? Tests choosing prompt chaining for predictable multi-aspect reviews over dynamic decomposition.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Prompt chainingrunning the review as a fixed series of focused steps, one per aspect
Workflowa predefined path through steps, which suits a review whose steps never change

Study: Workflows vs agents — Anthropic's decision rule Prompt chaining Workflow

Understand Foundations Mock Exam 2 · Q621's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The aspects are known and fixed, and consistency is required. A prompt chain with one focused step per aspect plus a summary fits. Adaptive planning belongs to open-ended investigations.

Connect the design to the situation

Security, compatibility and migration checks on every pull request, in a fixed order.

Best answer: C. The aspects and their order are known in advance, so a fixed prompt chain gives focused, consistent and auditable steps. Dynamic decomposition suits open-ended work whose next steps depend on findings. The autonomous agent may skip an aspect on some pull requests, which breaks the consistency requirement.

The decisive evidence in the stem

the same aspects on every pull request in the same order A predictable, repeated sequence of review aspects is the case prompt chaining fits, not adaptive planning.

Official objective tested: Task 1.6 · Design task decomposition strategies for complex workflows

What each choice would do here

A · Why this does not meet the full requirement

Four independent agents that each review one aspect and post their own comments directly, with no summary step joining their results.

Loses the summary and lets four agents post overlapping or conflicting comments.

Developers receive four separate sets of comments, sometimes contradictory, with no summary. Nothing joins the results into a single verdict for the pull request. Developers must reconcile them by hand.

B · Why this does not meet the full requirement

An autonomous agent that decides for each pull request which aspects to check and in what order, based on what it discovers in the diff.

Adds variability where the requirement is consistency, and an aspect may be skipped.

On a small pull request the agent decides migrations are irrelevant and skips them, though the diff touches a migration file. Auditors cannot show that every pull request received the same checks.

C · Why this meets the requirement

A fixed prompt chain with one focused step per aspect and a final summary step, keeping dynamic planning for open-ended jobs such as flaky-test investigations.

Matches a predictable review: every aspect is checked every time, with focused steps.

Step one reviews security with a security-only prompt, step two checks API compatibility, step three migration safety, and step four summarizes. Every pull request goes through all four, and the logs show each step's output for audit.

D · Why this does not meet the full requirement

One combined prompt that asks Claude to check security, compatibility and migrations together and then write the summary in the same response.

Puts all aspects into one step, which dilutes attention across them.

One response covers all aspects, and attention spreads thin. Security findings are detailed, but migration safety gets one vague line on large pull requests. Attention is spread, and quality varies with diff size.

Check your understanding · explain the design in your own words

The review always checks the same things in the same order. Fixed chain or self-planning agent?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Workflows vs agents — Anthropic's decision rule

Study: Workflows vs agents — Anthropic's decision rule Prompt chaining Workflow

Return to Foundations Mock Exam 2 · Q621's situation and clause-by-clause explanation

D2 · Claude Code

Q622. A staff engineer wrote Lumen Ledger's review criteria, such as 'flag any money arithmetic using floating point', in ~/.claude/CLAUDE.md on their own laptop. Their local reviews follow the criteria well, but the CI review job and other developers' sessions ignore them. The criteria must apply in CI and in every developer's session. What should the team do? (Select ONE.) A) Move the criteria into the project CLAUDE.md, so CI and every developer load them from the shared, versioned file. B) Put the criteria in .claude/settings.json, so they are applied as configuration to every Claude Code session that opens the project. C) Ask every developer to copy the criteria into their own ~/.claude/CLAUDE.md and add the same file to each CI runner's home directory. D) Pass the criteria to the CI job with a system prompt flag, and leave the staff engineer's user-level file as the source for local sessions.

Understand Foundations Mock Exam 2 · Q622 · the situation and each part of the question

The real situation behind this question

At Lumen Ledger, a staff engineer carefully wrote review criteria and saved them in their personal Claude Code memory. Their local reviews catch floating-point money bugs. The CI review job does not, and neither do other developers' sessions. The team wants these criteria everywhere, kept in one place, and changed through normal code review. A single source of truth is the goal.

Read the question in parts

Part 1 · Their local reviews follow the criteria well

the criteria themselves work; the issue is where they are stored.

Part 2 · must apply in CI and in every developer's session

the storage location must be shared by all sessions, which means the repository.

What you are being asked to decide

Review rules sit in one person's home folder. How do they reach CI and the whole team? Tests diagnosing user-level versus project-level CLAUDE.md scope.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
CLAUDE.mdthe memory file Claude Code loads as instructions; its location decides who receives it
Claude config filesthe set of files (CLAUDE.md, settings.json, .mcp.json) with different jobs and scopes

Study: CLAUDE.md — the memory hierarchy CLAUDE.md Claude config files

Understand Foundations Mock Exam 2 · Q622's answer · full reasoning and worked examples
Claude synthesized · the point, straight

User-level memory reaches only its owner. Criteria that must apply in CI and for every developer belong in the project CLAUDE.md, shared through version control.

Connect the design to the situation

Floating-point money rules work for one engineer but not in CI.

Best answer: A. User-level CLAUDE.md applies only to that user and is not shared through version control. The project CLAUDE.md is loaded by every session in the repository, including the CI job. A CI flag would cover CI only and leave developers without the criteria.

The decisive evidence in the stem

in ~/.claude/CLAUDE.md on their own laptop User-level memory applies only to its owner, which explains why CI and teammates never see the criteria.

Official objective tested: Task 3.1 · Configure CLAUDE.md files with appropriate hierarchy, scoping, and modular organization

What each choice would do here

A · Why this meets the requirement

Move the criteria into the project CLAUDE.md, so CI and every developer load them from the shared, versioned file.

Puts the shared criteria in the shared, versioned file every session loads.

The criteria move to CLAUDE.md at the repository root and are reviewed like code. The CI job and every developer's session load them, so a floating-point amount is flagged on every pull request and on every laptop.

B · Why this does not meet the full requirement

Put the criteria in .claude/settings.json, so they are applied as configuration to every Claude Code session that opens the project.

settings.json holds configuration such as permissions, not instructions.

settings.json configures permissions, hooks and environment, not review instructions. Claude never reads the criteria as guidance, so nothing changes for CI or developers. The criteria are simply ignored in every session.

C · Why this does not meet the full requirement

Ask every developer to copy the criteria into their own ~/.claude/CLAUDE.md and add the same file to each CI runner's home directory.

Creates many unversioned copies that drift, and ephemeral runners lose them.

Forty developers keep forty copies, which drift after the first edit. CI runners are recreated per job, so the copied file disappears, and the CI review again ignores the criteria.

D · Why this does not meet the full requirement

Pass the criteria to the CI job with a system prompt flag, and leave the staff engineer's user-level file as the source for local sessions.

Covers CI only, so developers' local sessions still miss the criteria.

CI now flags floating-point money, but developers' local sessions still do not. Two sources of truth exist, and changes to one are easily forgotten in the other.

Check your understanding · explain the design in your own words

Review rules sit in one person's home folder. How do they reach CI and the whole team?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: CLAUDE.md — the memory hierarchy

Study: CLAUDE.md — the memory hierarchy CLAUDE.md Claude config files

Return to Foundations Mock Exam 2 · Q622's situation and clause-by-clause explanation

D2 · Claude Code

Q623. A developer is using Claude Code to fix the script that posts review findings as inline comments. Three problems exist: comments on deleted lines land one line off, duplicate detection uses those line numbers as keys, and multi-line suggestions break at hunk boundaries. Changing the line mapping changes the duplicate keys and the hunk handling. How should the developer present these problems to Claude? (Select ONE.) A) Open three separate Claude Code sessions, one for each problem, so that each fix is developed in its own focused context. B) Report the off-by-one problem first, wait for the fix, then report the duplicate problem, and finally report the multi-line problem. C) Describe all three problems and how they interact in one detailed message, so Claude can design one consistent mapping fix. D) Ask Claude to 'fix the comment-posting bugs' and let it discover the three problems itself by reading the script and its logs.

Understand Foundations Mock Exam 2 · Q623 · the situation and each part of the question

The real situation behind this question

Lumen Ledger's comment-posting script has three visible bugs. A developer has traced them and found they all depend on how diff line numbers are mapped to file lines. Fixing that mapping changes how duplicates are detected and how multi-line suggestions are split. The developer is about to ask Claude Code for help and must decide how to present the problems.

Read the question in parts

Part 1 · duplicate detection uses those line numbers as keys

the second bug depends directly on the first, so they cannot be fixed separately.

Part 2 · multi-line suggestions break at hunk boundaries

the third bug also involves line mapping, completing the interaction.

What you are being asked to decide

Three bugs share one cause and affect each other. Report them together or one at a time? Tests choosing a single detailed message for interacting issues versus sequential fixes.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Claude Codethe CLI where the developer and Claude iterate on the posting script
Regressiona fix for one bug breaking something that worked, likely if interacting bugs are fixed separately

Study: Iterative refinement: getting Claude from 'close' to 'right' Claude Code Regression

Understand Foundations Mock Exam 2 · Q623's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The three problems share one mechanism, so fixing them separately causes conflicts. Put all of them, and how they interact, in one detailed message so Claude designs one consistent fix.

Connect the design to the situation

Line mapping, duplicate keys and hunk handling all depend on the same calculation.

Best answer: C. When fixes interact, presenting the problems together lets Claude design one coherent change. Fixing them one at a time works for independent issues, but here each fix changes the ground under the others, so sequential fixes would conflict and need rework.

The decisive evidence in the stem

Changing the line mapping changes the duplicate keys and the hunk handling The three problems all depend on one shared line-mapping mechanism, so fixing any one of them changes the other two.

Official objective tested: Task 3.5 · Apply iterative refinement techniques for progressive improvement

What each choice would do here

A · Why this does not meet the full requirement

Open three separate Claude Code sessions, one for each problem, so that each fix is developed in its own focused context.

Three isolated contexts produce three incompatible fixes to one mechanism.

Each session changes the line mapping in its own way. Merging three different mappings creates conflicts, and the developer must redo the work in one place anyway.

B · Why this does not meet the full requirement

Report the off-by-one problem first, wait for the fix, then report the duplicate problem, and finally report the multi-line problem.

Sequential fixes suit independent problems; here each fix disturbs the next.

Claude fixes the off-by-one mapping. The duplicate keys now change, so old comments are re-posted, and the second round must undo part of the first fix. The developer goes back and forth.

C · Why this meets the requirement

Describe all three problems and how they interact in one detailed message, so Claude can design one consistent mapping fix.

Gives Claude the full picture needed for one consistent fix.

Claude sees the whole picture, proposes one corrected line-mapping function, updates the duplicate keys to use it, and handles hunk boundaries with the same function. One review covers the change, and all three bugs are fixed consistently.

D · Why this does not meet the full requirement

Ask Claude to 'fix the comment-posting bugs' and let it discover the three problems itself by reading the script and its logs.

Leaves Claude to rediscover facts the developer already knows, including the interactions.

Claude may find one or two problems and fix them in isolation, missing the interaction. The developer already knew the full picture and withheld it.

Check your understanding · explain the design in your own words

Three bugs share one cause and affect each other. Report them together or one at a time?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Iterative refinement: getting Claude from 'close' to 'right'

Study: Iterative refinement: getting Claude from 'close' to 'right' Claude Code Regression

Return to Foundations Mock Exam 2 · Q623's situation and clause-by-clause explanation

D3 · Prompting & Structured Output

Q624. In the auto-fix job, one Claude Code session writes a fix for a failing test and then, in the same session, is asked to 'review your change for bugs before it is committed'. The self-review approves 98% of fixes, yet developers later find that one in eight auto-fixes breaks behaviour outside the failing test. How should the job review fixes? (Select ONE.) A) Use a larger model for the generating session, so that its fixes contain fewer bugs and its self-reviews become more reliable. B) Enable extended thinking in the generating session, so that it reasons more carefully when it reviews its own change before committing. C) Have a second, independent Claude instance review the diff and test results without the generator's reasoning, before commit. D) Ask the generating session to review its change twice in a row and commit only when both of its reviews approve the fix.

Understand Foundations Mock Exam 2 · Q624 · the situation and each part of the question

The real situation behind this question

Lumen Ledger's auto-fix job writes fixes for failing tests and reviews them in the same session before committing. The reviews almost always pass. But developers keep finding that some fixes make the failing test pass by breaking something nearby, such as rounding in another report. The platform team wants a review step that actually catches these problems before they reach the main branch.

Read the question in parts

Part 1 · The self-review approves 98% of fixes

the approval rate is suspiciously high compared with the real defect rate.

Part 2 · breaks behaviour outside the failing test

the missed issues are side effects the generator did not consider.

What you are being asked to decide

The session that wrote a fix also reviews it and almost always approves. How should fixes be reviewed? Tests using an independent review instance instead of self-review in the generating session.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Evaluator-optimizera pattern where a separate evaluator checks a generator's output
Context isolationthe reviewer starting without the generator's reasoning, so it judges the diff fresh

Study: Independent review and multi-pass review Evaluator-optimizer Context isolation

Understand Foundations Mock Exam 2 · Q624's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The reviewer shares the generator's reasoning, so it rarely questions the fix. Use a second, independent instance without that context to review the diff before committing.

Connect the design to the situation

Self-review approves 98% of fixes, but one in eight breaks other behaviour.

Best answer: C. A session that generated a change keeps its reasoning context and is less likely to question its own decisions. An independent instance without that context catches issues the generator overlooks. Extended thinking in the same session still reviews through the same reasoning that produced the fix.

The decisive evidence in the stem

in the same session The reviewer shares the generator's reasoning context, which is the known weakness of self-review compared with an independent instance.

Official objective tested: Task 4.6 · Design multi-instance and multi-pass review architectures

What each choice would do here

A · Why this does not meet the full requirement

Use a larger model for the generating session, so that its fixes contain fewer bugs and its self-reviews become more reliable.

A larger model in the same setup keeps the self-review weakness.

Fixes may improve slightly, but the review still happens inside the generating context. The blind spot about side effects remains. The approval rate stays high while defects continue.

B · Why this does not meet the full requirement

Enable extended thinking in the generating session, so that it reasons more carefully when it reviews its own change before committing.

More reasoning in the same session still starts from the same assumptions.

The session thinks longer about its change but from the same starting assumption that the rounding change was safe. It produces a longer justification and still approves.

C · Why this meets the requirement

Have a second, independent Claude instance review the diff and test results without the generator's reasoning, before commit.

A fresh reviewer is not anchored by the reasoning that produced the fix.

A new Claude instance receives only the diff, the failing test and the module's tests. It asks why a shared rounding helper changed and flags that two other reports depend on it. The fix is reworked before commit.

D · Why this does not meet the full requirement

Ask the generating session to review its change twice in a row and commit only when both of its reviews approve the fix.

Two self-reviews share the same blind spot.

Both reviews come from the same context and reach the same conclusion. The approval rate stays near 98%, and costs rise. The real defect rate stays the same.

Check your understanding · explain the design in your own words

The session that wrote a fix also reviews it and almost always approves. How should fixes be reviewed?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Independent review and multi-pass review

Study: Independent review and multi-pass review Evaluator-optimizer Context isolation

Return to Foundations Mock Exam 2 · Q624's situation and clause-by-clause explanation

D2 · Claude Code

Q625. Developers raise two complaints about the review job. First, after each new commit to a pull request, the job posts comments again on issues it already reported. Second, the script that turns Claude's findings into inline comments breaks whenever the wording or layout of Claude's prose changes. Which TWO changes address these complaints? (Select TWO.) A) Run the review with --output-format json and --json-schema, so the findings arrive as structured objects the posting script can parse. B) Include the prior findings on each rerun and instruct Claude to report only new or still-unaddressed issues. C) Parse Claude's prose output with a more flexible regular expression that tolerates small changes in wording and line layout. D) Lower the temperature for the review so reruns produce identical wording, which lets GitHub merge repeated comments on the same code line.

Understand Foundations Mock Exam 2 · Q625 · the situation and each part of the question

The real situation behind this question

Lumen Ledger's developers like the review job's findings but not its behaviour. Every new commit brings the same comments again, cluttering pull requests. And the posting script is fragile: when Claude changes a heading or bullet style, comments fail to post. The platform team must fix both problems with changes that hold up across hundreds of pull requests. Trust in the job is falling.

Read the question in parts

Part 1 · after each new commit to a pull request

reruns happen often, so duplicates multiply quickly without memory of prior findings.

Part 2 · breaks whenever the wording or layout of Claude's prose changes

the script depends on free-form text, which needs a structured format instead.

What you are being asked to decide

Reruns repeat old comments, and parsing prose keeps breaking. Which two changes fix these? Tests passing prior findings on reruns and enforcing structured CI output with CLI flags.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Headlessrunning Claude Code with -p in CI, without a person in the session
Structured outputsfindings returned as JSON matching a schema instead of free prose

Study: Claude Code in CI/CD (scenario 5 — CI/CD automation — territory) Headless Structured outputs

Understand Foundations Mock Exam 2 · Q625's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Duplicates come from reruns that lack earlier findings; parser breaks come from prose. Pass prior findings and ask for only new or unaddressed issues, and use --output-format json with --json-schema.

Connect the design to the situation

The same SQL-injection warning is posted on every commit, and the parser fails on a new heading.

Best answer: AB. Duplicate comments come from reviewing each commit with no memory of earlier findings, so passing them in and asking for only new or unaddressed issues fixes that. Parsing prose is fragile; --output-format json with --json-schema produces machine-parseable findings. A more flexible regular expression is still guessing at free-form text.

The decisive evidence in the stem

the job posts comments again on issues it already reported Each run lacks the earlier findings, so it cannot know which issues were already reported.

Official objective tested: Task 3.6 · Integrate Claude Code into CI/CD pipelines

What each choice would do here

A · Why this does not meet the full requirement

Run the review with --output-format json and --json-schema, so the findings arrive as structured objects the posting script can parse.

Produces machine-parseable findings that match a schema the script relies on.

Claude returns an object with an array of findings, each with file, line, severity and message, validated against the schema. The script reads fields instead of parsing prose and stops breaking on style changes.

B · Why this does not meet the full requirement

Include the prior findings on each rerun and instruct Claude to report only new or still-unaddressed issues.

Gives each rerun the earlier findings, so only new or unaddressed issues are reported.

The job loads the earlier findings from the last run's artifact and adds them to the prompt: 'Report only issues that are new or still present'. The SQL-injection warning that was fixed is dropped, and unchanged issues are not posted twice.

C · Why this does not meet the full requirement

Parse Claude's prose output with a more flexible regular expression that tolerates small changes in wording and line layout.

Still parses free-form prose, so the next format change breaks it again.

The regular expression survives a few more variations, then fails on a new layout. The team keeps patching a parser that depends on wording it does not control.

D · Why this does not meet the full requirement

Lower the temperature for the review so reruns produce identical wording, which lets GitHub merge repeated comments on the same code line.

GitHub does not merge comments, and wording can still change between runs.

Lower temperature makes wording more stable but not identical, and GitHub posts every comment it receives. Developers still see duplicates on each commit. The noise continues.

Walk through complete payloads or code · every step explained

Illustrative examples, not recorded live calls. Check each block's direction and endpoint: API requests, API responses, MCP messages, and configuration files are different contracts.

CI invocation with structured output (illustrative)

TEXT
claude -p "Review this diff. Prior findings are in prior.json; report only new or still-unaddressed issues." \
  --output-format json \
  --json-schema "$(cat .github/review-schema.json)"

The prior findings stop duplicates; the schema flags make the result parseable. They solve two different complaints.

Which omitted settings use defaults or leave features unconfigured?

Check your understanding · explain the design in your own words

Reruns repeat old comments, and parsing prose keeps breaking. Which two changes fix these?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Claude Code in CI/CD (scenario 5 — CI/CD automation — territory)

Study: Claude Code in CI/CD (scenario 5 — CI/CD automation — territory) Headless Structured outputs

Return to Foundations Mock Exam 2 · Q625's situation and clause-by-clause explanation

D2 · Claude Code

Q626. Lumen Ledger's ledger/ directory has its own CLAUDE.md that imports money-handling rules with @import. A developer reports that in their local Claude Code sessions, Claude ignores those rules when editing ledger code, while teammates' sessions follow them. Nobody knows which memory files that developer's sessions actually load. What should the developer do first? (Select ONE.) A) Copy the money-handling rules into the developer's own ~/.claude/CLAUDE.md, so they load regardless of how the project is set up. B) Rewrite the money-handling rules in capital letters with stronger wording, so that Claude treats them as more important in every session. C) Reinstall Claude Code on the developer's laptop and clear its cache, so the next session starts from a clean installation state. D) Run /memory in a session working on ledger code to see which memory files are loaded, then compare the list with a teammate's session.

Understand Foundations Mock Exam 2 · Q626 · the situation and each part of the question

The real situation behind this question

Lumen Ledger keeps strict money-handling rules for the ledger code, imported into ledger/CLAUDE.md. For most developers, Claude follows them. One developer finds Claude ignores them, for example suggesting floating-point arithmetic. Their checkout layout or session setup may differ, but nobody has checked what their sessions load. The team needs a first step that finds the cause. Guessing would waste time.

Read the question in parts

Part 1 · while teammates' sessions follow them

the rules work in general, so the difference lies in this developer's session setup.

Part 2 · imports money-handling rules with @import

the rules depend on an import chain, which may break or not load in some setups.

What you are being asked to decide

One developer's sessions ignore rules that work for everyone else. How do you find out why? Tests using /memory to diagnose which memory files load in a session.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
CLAUDE.mdthe memory files at user, project and directory level that Claude Code may load
Modular promptinstructions split into imported files, such as the money rules pulled in with @import

Study: CLAUDE.md — the memory hierarchy CLAUDE.md Modular prompt

Understand Foundations Mock Exam 2 · Q626's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The sessions differ, and the unknown is which memory files load. /memory lists them, so it is the first diagnostic step before any change.

Connect the design to the situation

Money rules imported in ledger/CLAUDE.md are missing in one developer's sessions.

Best answer: D. The behaviour differs between sessions, and the open question is which memory files load. The /memory command shows exactly that, so it diagnoses the cause before any change. Copying the rules into user-level memory may hide the symptom while the real configuration problem stays unknown.

The decisive evidence in the stem

Nobody knows which memory files that developer's sessions actually load The first step must answer this question, and /memory is the command that lists loaded memory files.

Official objective tested: Task 3.1 · Configure CLAUDE.md files with appropriate hierarchy, scoping, and modular organization

What each choice would do here

A · Why this does not meet the full requirement

Copy the money-handling rules into the developer's own ~/.claude/CLAUDE.md, so they load regardless of how the project is set up.

Masks the problem with a personal copy that drifts from the team's file.

The developer's sessions now follow a personal copy. When the team updates the rules, this copy stays old, and the original loading problem remains hidden.

B · Why this does not meet the full requirement

Rewrite the money-handling rules in capital letters with stronger wording, so that Claude treats them as more important in every session.

Changes wording when the rules may not be loaded at all.

If the file never loads, the stronger wording never reaches Claude either. The developer spends time rewriting rules that teammates already follow without problems. Nothing about loading changes.

C · Why this does not meet the full requirement

Reinstall Claude Code on the developer's laptop and clear its cache, so the next session starts from a clean installation state.

A broad reset that may change nothing and still leaves the cause unknown.

Reinstalling takes time and does not touch the repository layout or the memory files. If the cause is the checkout, the next session ignores the rules again.

D · Why this meets the requirement

Run /memory in a session working on ledger code to see which memory files are loaded, then compare the list with a teammate's session.

Shows which files load, which is the unknown fact causing the difference.

The developer runs /memory and sees that ledger/CLAUDE.md is not listed, because they start Claude Code from a separate worktree with an outdated copy. The cause is clear in a minute, and the fix is targeted.

Check your understanding · explain the design in your own words

One developer's sessions ignore rules that work for everyone else. How do you find out why?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: CLAUDE.md — the memory hierarchy

Study: CLAUDE.md — the memory hierarchy CLAUDE.md Modular prompt

Return to Foundations Mock Exam 2 · Q626's situation and clause-by-clause explanation

D4 · Tools & MCP

Q627. The review job should read linked tickets through the team's issue-tracker MCP server, and developers want the same server in their local Claude Code sessions. A developer added the server to the project's .mcp.json with the API token pasted in as plain text, and the security scanner flagged the commit. How should the server be configured? (Select ONE.) A) Store the token in the project CLAUDE.md with an instruction that Claude must pass it to the MCP server when it first connects. B) Add .mcp.json to .gitignore, so each developer and the CI job keeps a private copy of the file with the token written in directly. C) Keep the server in the project .mcp.json, reference the token as ${TRACKER_API_TOKEN}, and supply it from CI secrets and local shells. D) Move the server configuration into ~/.claude.json on every CI runner and every developer's laptop, so no token is ever stored in the repository.

Understand Foundations Mock Exam 2 · Q627 · the situation and each part of the question

The real situation behind this question

Lumen Ledger's review job would be more useful if it could read the ticket linked to each pull request. Developers also want that server locally. One developer committed .mcp.json with a real token in it, and the security scanner caught it. The platform team wants one shared server definition that works in CI and locally, without any secret in the repository.

Read the question in parts

Part 1 · developers want the same server in their local Claude Code sessions

the server is shared team tooling, which belongs in project scope.

Part 2 · the security scanner flagged the commit

the secret, not the shared config itself, is the problem to fix.

What you are being asked to decide

A shared MCP server config contains a secret token. How do you share the server without sharing the secret? Tests project-scoped .mcp.json with environment variable expansion for credentials.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
.mcp.jsonthe project file in the repository that defines MCP servers for everyone, including CI
MCP serverthe issue-tracker integration that both CI and developers need

Study: MCP and tool config files: where each one lives .mcp.json MCP server

Understand Foundations Mock Exam 2 · Q627's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The server is shared tooling, so it belongs in project .mcp.json. The secret comes from the environment through ${VAR} expansion, set by CI secrets and by each developer.

Connect the design to the situation

A committed .mcp.json with a literal tracker token trips the security scanner.

Best answer: C. Project-scoped .mcp.json shares team tooling through version control, and environment variable expansion keeps the secret out of the file. User-scoped ~/.claude.json is for personal or experimental servers; copying it to every machine loses the shared, versioned definition.

The decisive evidence in the stem

the API token pasted in as plain text The shared configuration is right, but the secret must come from the environment through variable expansion, not from the committed file.

Official objective tested: Task 2.4 · Integrate MCP servers into Claude Code and agent workflows

What each choice would do here

A · Why this does not meet the full requirement

Store the token in the project CLAUDE.md with an instruction that Claude must pass it to the MCP server when it first connects.

Commits the secret in another file and relies on the model to handle credentials.

The token is again committed, now in CLAUDE.md, and the model would see it in its context. MCP authentication is configured in .mcp.json, not by instructions.

B · Why this does not meet the full requirement

Add .mcp.json to .gitignore, so each developer and the CI job keeps a private copy of the file with the token written in directly.

Removes the shared definition from version control, so setups diverge.

Every developer writes their own .mcp.json, and some use old server versions. CI needs a separate way to create the file, and the team no longer reviews changes to it.

C · Why this meets the requirement

Keep the server in the project .mcp.json, reference the token as ${TRACKER_API_TOKEN}, and supply it from CI secrets and local shells.

Shares one versioned definition and keeps the secret in the environment.

The committed .mcp.json says "Authorization": "Bearer ${TRACKER_API_TOKEN}". GitHub Actions sets TRACKER_API_TOKEN from a repository secret, and developers export their own token. Everyone uses the same versioned server definition.

D · Why this does not meet the full requirement

Move the server configuration into ~/.claude.json on every CI runner and every developer's laptop, so no token is ever stored in the repository.

User-level files are personal and unversioned, so every machine drifts.

Each runner and laptop needs a hand-edited file. When the server URL changes, someone must update dozens of machines, and ephemeral CI runners lose the file on every job.

Walk through complete payloads or code · every step explained

Illustrative examples, not recorded live calls. Check each block's direction and endpoint: API requests, API responses, MCP messages, and configuration files are different contracts.

Project .mcp.json with variable expansion (illustrative)

JSON
{"mcpServers": {"tracker": {"type": "http", "url": "https://tracker.example.com/mcp", "headers": {"Authorization": "Bearer ${TRACKER_API_TOKEN}"}}}}

The file is committed; the token is read from the environment when Claude Code connects.

Which omitted settings use defaults or leave features unconfigured?

Check your understanding · explain the design in your own words

A shared MCP server config contains a secret token. How do you share the server without sharing the secret?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: MCP and tool config files: where each one lives

Study: MCP and tool config files: where each one lives .mcp.json MCP server

Return to Foundations Mock Exam 2 · Q627's situation and clause-by-clause explanation

D2 · Claude Code

Q628. Since yesterday, the test-generation job fails on every run. The log shows "error: unknown option '--output-fromat'" and points to line 42 of .github/workflows/testgen.yml, where a teammate mistyped the flag during an unrelated change. A developer opens Claude Code to fix it. Which way of working fits this task? (Select ONE.) A) Use plan mode to explore every workflow file and propose a plan for the CLI flags they use before making any change at all. B) Use direct execution: ask Claude to correct the flag on line 42, then check the change and rerun the job to confirm it passes. C) Use the Explore subagent to survey all workflow files and summarize their flags, then decide whether a change is needed at all. D) Use the interview pattern so Claude asks questions about the team's CI design goals before it touches the workflow file.

Understand Foundations Mock Exam 2 · Q628 · the situation and each part of the question

The real situation behind this question

Lumen Ledger's test-generation job has failed on every run since yesterday. The CI log is precise: an unknown option on line 42 of one workflow file, a typo introduced by a teammate. Developers are waiting for the job to work again. One developer opens Claude Code to fix it and must decide how much process this fix needs. Speed matters here.

Read the question in parts

Part 1 · a teammate mistyped the flag during an unrelated change

the cause is a simple typo, not a design problem.

Part 2 · fails on every run

the fix is urgent, and extra process only delays it.

What you are being asked to decide

A typo in one workflow line breaks CI. Plan first, or fix it directly? Tests selecting direct execution for a well-scoped single-file fix.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Claude Codethe CLI the developer opens to make the fix
Permission modethe session mode; plan mode only explores and proposes, direct execution edits

Study: Plan mode vs direct execution — and the Explore subagent Claude Code Permission mode

Understand Foundations Mock Exam 2 · Q628's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The error names the file, the line and the cause. A well-scoped one-line fix fits direct execution; plan mode is for tasks with design choices or many files.

Connect the design to the situation

'--output-fromat' on line 42 breaks every test-generation run.

Best answer: B. The task is a single, well-understood fix with a precise error and location, which is what direct execution is for. Plan mode helps when there are architectural choices or many files; here it adds steps without reducing risk.

The decisive evidence in the stem

points to line 42 of .github/workflows/testgen.yml The error, the file and the line are all known, so the change is clear and small.

Official objective tested: Task 3.4 · Determine when to use plan mode vs direct execution

What each choice would do here

A · Why this does not meet the full requirement

Use plan mode to explore every workflow file and propose a plan for the CLI flags they use before making any change at all.

Adds exploration and planning to a one-line typo with a known location.

Claude explores twelve workflow files and writes a plan about flag conventions. The developer reads it, approves, and then the one-character fix happens. The job stays broken longer for no benefit.

B · Why this meets the requirement

Use direct execution: ask Claude to correct the flag on line 42, then check the change and rerun the job to confirm it passes.

A small, clear fix: correct it, verify, rerun.

Claude changes '--output-fromat' to '--output-format' on line 42 and shows the diff. The developer approves, pushes, and the next run passes. The whole fix takes a few minutes.

C · Why this does not meet the full requirement

Use the Explore subagent to survey all workflow files and summarize their flags, then decide whether a change is needed at all.

A survey of all workflows is unnecessary when the error names the line.

The Explore subagent returns a summary of all flags in all workflows. It confirms what the log already said, and the actual fix still has to be made afterwards.

D · Why this does not meet the full requirement

Use the interview pattern so Claude asks questions about the team's CI design goals before it touches the workflow file.

No design questions exist; the flag is simply misspelled.

Claude asks about CI goals, retry policies and output formats. None of these answers change the fix, and the developer spends time on a conversation the typo did not need.

Check your understanding · explain the design in your own words

A typo in one workflow line breaks CI. Plan first, or fix it directly?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Plan mode vs direct execution — and the Explore subagent

Study: Plan mode vs direct execution — and the Explore subagent Claude Code Permission mode

Return to Foundations Mock Exam 2 · Q628's situation and clause-by-clause explanation

D2 · Claude Code

Q629. Each of Lumen Ledger's twelve services keeps SQL migrations under services//db/migrations/. Migrations must follow strict conventions: reversible steps, no column drops without a deprecation period, and explicit lock timeouts. These conventions currently sit in the root CLAUDE.md and load for every task. What's the most maintainable way to apply them only when Claude works on migration files? (Select ONE.) A) Create a /migration-rules skill that developers must remember to invoke before Claude edits or reviews any migration file. B) Add a CLAUDE.md file to each of the twelve migrations directories, each containing a copy of the same migration conventions. C) Keep the conventions in the root CLAUDE.md under a clear 'Migrations' heading, so Claude can find them quickly when they matter. D) Create .claude/rules/migrations.md with a paths glob of services//db/migrations/**/.sql, so it loads only for those files.

Understand Foundations Mock Exam 2 · Q629 · the situation and each part of the question

The real situation behind this question

Lumen Ledger's twelve services each own their database migrations, but the conventions are the same everywhere and strict. Today they sit in the root CLAUDE.md, so they load even when a developer is changing CSS or a CI job reviews a README edit. The team wants them applied exactly when migration files are involved, and maintained in one place. Drift between services is a risk.

Read the question in parts

Part 1 · load for every task

the current setup loads migration conventions even for unrelated work, wasting context.

Part 2 · only when Claude works on migration files

the rule must activate by file path, which a paths glob provides.

What you are being asked to decide

Migration rules should load only for migration files in twelve folders. How? Tests path-scoped rules with glob patterns for conventions spread across directories.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Frontmatterthe YAML header in the rules file that holds the paths glob
Context budgetthe context saved when migration rules no longer load for unrelated tasks

Study: .claude/rules/ — path-scoped conventions with glob frontmatter Frontmatter Context budget

Understand Foundations Mock Exam 2 · Q629's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The files are spread over twelve directories, and the rules matter only for them. One path-scoped rules file with a glob loads exactly then, and it stays maintained in one place.

Connect the design to the situation

Twelve services, each with its own migrations folder, sharing one convention set.

Best answer: D. A path-scoped rule with a glob loads only when Claude works on matching files, wherever they sit, and it lives in one file. Twelve directory-level CLAUDE.md copies would work but drift apart as the conventions change. A skill depends on someone remembering to invoke it.

The decisive evidence in the stem

Each of Lumen Ledger's twelve services keeps SQL migrations The files are spread across many directories, which is where one glob-scoped rule beats many directory files.

Official objective tested: Task 3.3 · Apply path-specific rules for conditional convention loading

What each choice would do here

A · Why this does not meet the full requirement

Create a /migration-rules skill that developers must remember to invoke before Claude edits or reviews any migration file.

Depends on a person remembering, so it is often skipped.

Developers forget to run the skill, and the CI job does not invoke it. Many migrations get edited and reviewed without the conventions loaded. Coverage becomes a matter of memory.

B · Why this does not meet the full requirement

Add a CLAUDE.md file to each of the twelve migrations directories, each containing a copy of the same migration conventions.

Works but creates twelve copies that drift as conventions change.

Each copy works at first. Then a new lock-timeout rule is added to four copies and forgotten in eight. Reviews apply different conventions depending on the service.

C · Why this does not meet the full requirement

Keep the conventions in the root CLAUDE.md under a clear 'Migrations' heading, so Claude can find them quickly when they matter.

Still loads for every task, wasting context outside migration work.

Claude finds the section easily, but it still loads for every CSS change and every README review. The context cost the team wanted to remove stays the same.

D · Why this meets the requirement

Create .claude/rules/migrations.md with a paths glob of services//db/migrations/**/.sql, so it loads only for those files.

One file, loaded only for matching migration files in any service.

The rule file starts with paths: ["services/*/db/migrations/**/*.sql"]. When Claude edits services/payouts/db/migrations/0042_add_index.sql, the conventions load. When it edits a React component, they do not. Updates happen in one file.

Walk through complete payloads or code · every step explained

Illustrative examples, not recorded live calls. Check each block's direction and endpoint: API requests, API responses, MCP messages, and configuration files are different contracts.

.claude/rules/migrations.md (illustrative)

YAML
---
paths:
  - "services/*/db/migrations/**/*.sql"
---
# Migration conventions
- Every step must be reversible.
- Never drop a column without a deprecation period.
- Set an explicit lock_timeout.

The rule loads only when Claude works with a file matching the glob, in any of the twelve services.

Which omitted settings use defaults or leave features unconfigured?

Check your understanding · explain the design in your own words

Migration rules should load only for migration files in twelve folders. How?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: .claude/rules/ — path-scoped conventions with glob frontmatter

Study: .claude/rules/ — path-scoped conventions with glob frontmatter Frontmatter Context budget

Return to Foundations Mock Exam 2 · Q629's situation and clause-by-clause explanation

D3 · Prompting & Structured Output

Q630. Review comments fall into categories: security, correctness, and naming conventions. Naming comments have a 60% false-positive rate, and developers now dismiss review comments without reading them, including accurate security findings. The team expects that rewriting the naming criteria will take about two weeks. What should the team do now? (Select ONE.) A) Add 'be conservative about naming issues' to the prompt and keep all three categories running while the naming criteria are being rewritten. B) Keep all three categories but post naming comments at 'info' severity, so developers can tell them apart from the more important findings. C) Collapse all findings into one summary comment per pull request, so developers see fewer individual comments from every category combined. D) Turn off the naming category while its criteria are rewritten, and keep posting security and correctness findings.

Understand Foundations Mock Exam 2 · Q630 · the situation and each part of the question

The real situation behind this question

Lumen Ledger's review comments started well, but naming-convention comments are wrong more often than right. Developers learned to dismiss all comments, and last week a valid security warning was dismissed unread. The team plans to rewrite the naming criteria, which will take about two weeks. Until then, they must decide how to keep valuable comments trusted. Security comments must be read.

Read the question in parts

Part 1 · Naming comments have a 60% false-positive rate

one category is clearly the noisy one, so the response can target it.

Part 2 · will take about two weeks

the real fix is coming, so a temporary measure is needed in the meantime.

What you are being asked to decide

One noisy category makes developers ignore all comments. What do you do while fixing it? Tests temporarily disabling a high false-positive category to restore developer trust.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Evaluation metricsmeasures such as the 60% false-positive rate for naming comments
Regressionthe check, after rewriting, that naming criteria no longer produce false positives

Study: Explicit criteria: say what to report and what to skip Evaluation metrics Regression

Understand Foundations Mock Exam 2 · Q630's answer · full reasoning and worked examples
Claude synthesized · the point, straight

A noisy category destroys trust in good ones. Turn the noisy category off while its criteria are rewritten, and keep the accurate categories posting.

Connect the design to the situation

Naming comments are mostly wrong, so security comments get ignored too.

Best answer: D. A high false-positive category undermines trust in accurate categories. Disabling that category temporarily restores trust in security and correctness findings while its prompt is improved. A severity label still puts noisy comments in front of developers, who are already ignoring everything.

The decisive evidence in the stem

including accurate security findings The noisy category is damaging trust in the valuable ones, so removing the noise quickly matters more than labelling it.

Official objective tested: Task 4.1 · Design prompts with explicit criteria to improve precision and reduce false positives

What each choice would do here

A · Why this does not meet the full requirement

Add 'be conservative about naming issues' to the prompt and keep all three categories running while the naming criteria are being rewritten.

Vague caution does not fix a category with bad criteria.

Naming comments drop slightly, but the criteria are still wrong, so most remaining ones are still false. Developers keep dismissing everything, including security warnings. Nothing improves.

B · Why this does not meet the full requirement

Keep all three categories but post naming comments at 'info' severity, so developers can tell them apart from the more important findings.

Still posts noisy comments that developers have learned to ignore.

Naming comments still appear on every pull request, now marked 'info'. Developers who have stopped reading do not look at labels, so trust does not recover.

C · Why this does not meet the full requirement

Collapse all findings into one summary comment per pull request, so developers see fewer individual comments from every category combined.

Hides the problem in one comment and buries security findings with naming noise.

One long comment mixes a security warning with nine naming nits. Developers skim it, and the security warning is easier to miss than before. Trust drops further.

D · Why this meets the requirement

Turn off the naming category while its criteria are rewritten, and keep posting security and correctness findings.

Removes the noise now and protects trust in the categories that work.

For two weeks the job posts only security and correctness comments. Developers see fewer, more accurate comments and start reading them again. When the rewritten naming criteria pass testing, the category is re-enabled.

Check your understanding · explain the design in your own words

One noisy category makes developers ignore all comments. What do you do while fixing it?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Explicit criteria: say what to report and what to skip

Study: Explicit criteria: say what to report and what to skip Evaluation metrics Regression

Return to Foundations Mock Exam 2 · Q630's situation and clause-by-clause explanation

D3 · Prompting & Structured Output

Q631. The review prompt says 'Flag performance problems. Be conservative and only report high-confidence findings.' Developers dismiss 80% of performance comments, most of which flag small loops over in-memory lists of a few items, while a real N+1 query in a request handler went unreported last month. How should the team change the prompt? (Select ONE.) A) Require that two separate review runs both flag the same performance issue before the job posts it as a comment on the pull request. B) Ask Claude to attach a confidence score from 0 to 1 to each finding and post only those performance findings scored above 0.9. C) Strengthen the instruction to 'be extremely conservative' and report a performance finding only when Claude is certain it is a real problem. D) Define which issues to report, such as queries inside request-handler loops, and which to skip, such as loops over tiny lists.

Understand Foundations Mock Exam 2 · Q631 · the situation and each part of the question

The real situation behind this question

Lumen Ledger's review job comments on performance, but developers ignore most of those comments. They flag harmless loops over lists with three items. Meanwhile, a database query inside a loop in a request handler, a real performance bug, passed without comment and caused slow checkouts. The team wants performance comments developers trust. Every ignored comment lowers trust in the job further.

Read the question in parts

Part 1 · small loops over in-memory lists of a few items

the false positives follow a clear pattern that criteria can tell Claude to skip.

Part 2 · a real N+1 query in a request handler went unreported

vague caution also suppressed a real issue, so criteria must name what to report.

What you are being asked to decide

'Be conservative' did not stop bad performance comments. What should the prompt say instead? Tests explicit report-and-skip criteria versus confidence-based filtering.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Calibrationwhether a confidence score matches real accuracy; a self-reported 0.9 has not been checked
System promptthe review instructions where the report and skip criteria are written

Study: Explicit criteria: say what to report and what to skip Calibration System prompt

Understand Foundations Mock Exam 2 · Q631's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Vague confidence wording does not define a real problem. Name what to report and what to skip; precision rises and the real N+1 pattern gets flagged.

Connect the design to the situation

Comments flag tiny loops while a real N+1 query goes unreported.

Best answer: D. General instructions like 'be conservative' or 'high-confidence only' do not tell Claude what counts as a real problem; specific categorical criteria do. The comments are wrong about which patterns matter, so naming report and skip patterns fixes both the false positives and the missed N+1 query.

The decisive evidence in the stem

Be conservative and only report high-confidence findings The current prompt relies on vague confidence wording, which neither removes false positives nor catches the real issue.

Official objective tested: Task 4.1 · Design prompts with explicit criteria to improve precision and reduce false positives

What each choice would do here

A · Why this does not meet the full requirement

Require that two separate review runs both flag the same performance issue before the job posts it as a comment on the pull request.

Two runs can agree on the same wrong pattern and still miss the real issue.

Both runs flag the same tiny loops, because both follow the same vague prompt. Costs double and the N+1 query is still missed. Nothing defines the target.

B · Why this does not meet the full requirement

Ask Claude to attach a confidence score from 0 to 1 to each finding and post only those performance findings scored above 0.9.

Self-reported confidence is not calibrated and does not define what matters.

Claude gives 0.95 to many tiny-loop findings and 0.7 to the N+1 query. The threshold filters on numbers that do not reflect accuracy, so results barely improve.

C · Why this does not meet the full requirement

Strengthen the instruction to 'be extremely conservative' and report a performance finding only when Claude is certain it is a real problem.

More of the vague wording that already failed.

Claude flags fewer issues overall, including fewer real ones. The criteria for 'a real problem' are still undefined, so the tiny-loop comments keep appearing in a smaller number.

D · Why this meets the requirement

Define which issues to report, such as queries inside request-handler loops, and which to skip, such as loops over tiny lists.

Tells Claude exactly which patterns matter and which to ignore.

The prompt now lists 'Report: database or network calls inside loops in request handlers; unbounded loops over user input. Skip: loops over fixed in-memory collections; micro-optimizations'. Tiny loops stop being flagged, and the next N+1 query is reported.

Check your understanding · explain the design in your own words

'Be conservative' did not stop bad performance comments. What should the prompt say instead?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Explicit criteria: say what to report and what to skip

Study: Explicit criteria: say what to report and what to skip Calibration System prompt

Return to Foundations Mock Exam 2 · Q631's situation and clause-by-clause explanation

D2 · Claude Code

Q632. Lumen Ledger's root CLAUDE.md contains a 400-line release checklist covering changelog format, version bumps and API deprecation notices. Developers need it only when preparing a release pull request, about twice a month, but it loads into every session and every CI job. How should the team restructure it? (Select ONE.) A) Shorten the checklist to about 100 lines inside CLAUDE.md, keeping only the most important steps so it uses less context in each session. B) Move the checklist into each developer's ~/.claude/skills/ folder, so it stays out of the shared repository and loads only on demand. C) Move the checklist into .claude/rules/release.md without a paths field, so it lives in its own file separate from the main CLAUDE.md. D) Move the checklist into a project skill under .claude/skills/, committed to the repository, so developers invoke it on demand when preparing a release.

Understand Foundations Mock Exam 2 · Q632 · the situation and each part of the question

The real situation behind this question

Lumen Ledger's release checklist grew to 400 lines inside the root CLAUDE.md. It matters only on release days, about twice a month. The rest of the time it takes context in every developer session and every CI review, even for a one-line bug fix. The team wants the checklist available when needed without burdening every other session. Context in CI is limited too.

Read the question in parts

Part 1 · it loads into every session and every CI job

always-loaded content has a cost on every run, which is wasted here.

Part 2 · covering changelog format, version bumps and API deprecation notices

the content is a specific workflow, not a general standard.

What you are being asked to decide

A long checklist used twice a month loads everywhere. Where should it live? Tests choosing an on-demand skill over always-loaded CLAUDE.md for task-specific workflows.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Skilla procedure in .claude/skills/ that loads only when someone invokes it
CLAUDE.mdalways-loaded instructions, meant for standards every session needs

Study: Skills vs slash commands vs subagents — the discriminator Skill CLAUDE.md

Understand Foundations Mock Exam 2 · Q632's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The checklist is an occasional, task-specific procedure. A committed project skill loads it on demand for everyone; CLAUDE.md should keep only standards every session needs.

Connect the design to the situation

A release checklist fills context during ordinary bug fixes and CI reviews.

Best answer: D. CLAUDE.md is for standards that apply to every session; a task-specific procedure used occasionally belongs in a skill that loads on demand. A project skill is shared through version control. A rules file without a paths field still loads in every session.

The decisive evidence in the stem

only when preparing a release pull request, about twice a month A procedure needed only a few times a month should load on demand, not take context in every session and CI job.

Official objective tested: Task 3.2 · Create and configure custom slash commands and skills

What each choice would do here

A · Why this does not meet the full requirement

Shorten the checklist to about 100 lines inside CLAUDE.md, keeping only the most important steps so it uses less context in each session.

Still loads every time and loses steps the release process needs.

Sessions save some context, but the release process now lacks the deprecation steps that were cut. Release pull requests start missing notices that customers rely on.

B · Why this does not meet the full requirement

Move the checklist into each developer's ~/.claude/skills/ folder, so it stays out of the shared repository and loads only on demand.

On demand, but personal and unshared, so the team's copies drift.

Each developer keeps a personal copy. When the deprecation rules change, only some copies are updated, and new team members do not get the skill at all.

C · Why this does not meet the full requirement

Move the checklist into .claude/rules/release.md without a paths field, so it lives in its own file separate from the main CLAUDE.md.

Without paths, a rules file still loads in every session.

The file is tidier, but a rules file with no paths field loads in every session, just like CLAUDE.md. The context cost is unchanged. The file split changes nothing else.

D · Why this meets the requirement

Move the checklist into a project skill under .claude/skills/, committed to the repository, so developers invoke it on demand when preparing a release.

Loads the checklist only when needed and keeps it shared through the repository.

The checklist becomes .claude/skills/release-prep/SKILL.md. On release day a developer invokes /release-prep, and the full checklist loads into that session. Ordinary sessions and CI reviews no longer carry the 400 lines.

Check your understanding · explain the design in your own words

A long checklist used twice a month loads everywhere. Where should it live?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Skills vs slash commands vs subagents — the discriminator

Study: Skills vs slash commands vs subagents — the discriminator Skill CLAUDE.md

Return to Foundations Mock Exam 2 · Q632's situation and clause-by-clause explanation

D2 · Claude Code

Q633. The auto-fix job runs on five self-hosted runners and behaves differently depending on the runner. On two runners, the service account has user-level hooks and plugins that another team installed, and they change how Claude Code acts. The job's instructions live in .github/autofix.md. Which invocation gives the same behaviour on every runner? (Select ONE.) A) claude -p with the instructions in CLAUDE.md, after asking the other team to remove their hooks and plugins from those two runners. B) claude -p --system-prompt-file .github/autofix.md, so the job's instructions replace the default system prompt on every runner the job uses. C) claude -p --bare --append-system-prompt-file .github/autofix.md, which skips auto-discovered configuration and adds the job's instructions explicitly. D) claude -p --bare, with the job's instructions moved into the project CLAUDE.md so that Claude Code picks them up automatically on every runner.

Understand Foundations Mock Exam 2 · Q633 · the situation and each part of the question

The real situation behind this question

Lumen Ledger's auto-fix job gives different results depending on which self-hosted runner picks it up. Investigation shows that two runners' service accounts have hooks and plugins installed by another team for their own work. Claude Code loads these automatically. The platform team wants every run to behave the same, no matter which runner it lands on. Changing other teams' machines is not an option.

Read the question in parts

Part 1 · behaves differently depending on the runner

the run depends on machine state, which CI must not do.

Part 2 · The job's instructions live in .github/autofix.md

the instructions are in a dedicated file, which can be passed explicitly to the run.

What you are being asked to decide

Runners have different user configs that change Claude Code's behaviour. How do you make every run the same? Tests --bare with an explicit appended system prompt file for reproducible CI runs.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Headlessthe -p run in CI, where nobody is present to notice odd configuration
Settings precedencehow user, project and local settings combine, which --bare sidesteps by not auto-loading them

Study: Start fast and the same on every runner: --bare and the system prompt flags Headless Settings precedence

Understand Foundations Mock Exam 2 · Q633's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Auto-discovered user configuration makes runners differ. Use --bare to stop discovery, and pass the instructions with --append-system-prompt-file so they still load.

Connect the design to the situation

Two of five runners have another team's hooks, so auto-fix results differ by runner.

Best answer: C. --bare skips auto-discovery of hooks, plugins, skills, MCP servers and CLAUDE.md, so runner-specific user configuration no longer affects the run, and --append-system-prompt-file adds the job's instructions explicitly. --bare alone with CLAUDE.md drops the instructions, because CLAUDE.md is not loaded under --bare.

The decisive evidence in the stem

user-level hooks and plugins that another team installed Auto-discovered configuration differs between runners, so the fix is to turn auto-discovery off and pass what the job needs explicitly.

Official objective tested: Task 3.6 · Integrate Claude Code into CI/CD pipelines

What each choice would do here

A · Why this does not meet the full requirement

claude -p with the instructions in CLAUDE.md, after asking the other team to remove their hooks and plugins from those two runners.

Depends on another team's machines staying clean, which is not reproducible.

The runners match until the other team installs something again. Reproducibility depends on another team's habits rather than on the job's own invocation. It is fragile.

B · Why this does not meet the full requirement

claude -p --system-prompt-file .github/autofix.md, so the job's instructions replace the default system prompt on every runner the job uses.

Replaces the default prompt and still auto-loads the runners' hooks and plugins.

The job's instructions now replace the default coding-assistant prompt, losing its tool guidance. The two runners still auto-load the other team's hooks and plugins, so results still differ.

C · Why this meets the requirement

claude -p --bare --append-system-prompt-file .github/autofix.md, which skips auto-discovered configuration and adds the job's instructions explicitly.

Turns off runner-specific discovery and adds exactly the job's instructions.

Every runner starts Claude Code without discovering user hooks, plugins or memory, then appends .github/autofix.md to the default prompt. The two special runners now behave exactly like the other three.

D · Why this does not meet the full requirement

claude -p --bare, with the job's instructions moved into the project CLAUDE.md so that Claude Code picks them up automatically on every runner.

--bare skips CLAUDE.md, so the moved instructions never load.

Runs are now the same on every runner, but the instructions are missing, because --bare skips CLAUDE.md. The auto-fix job loses its guidance on how to fix tests.

Walk through complete payloads or code · every step explained

Illustrative examples, not recorded live calls. Check each block's direction and endpoint: API requests, API responses, MCP messages, and configuration files are different contracts.

Reproducible auto-fix step (illustrative)

YAML
- name: Auto-fix failing tests
  run: |
    claude -p "Fix the failing tests listed in failures.txt" \
      --bare \
      --append-system-prompt-file .github/autofix.md \
      --output-format json

--bare stops auto-discovery on the runner; the appended file supplies the job's instructions on top of the default prompt.

Which omitted settings use defaults or leave features unconfigured?

Check your understanding · explain the design in your own words

Runners have different user configs that change Claude Code's behaviour. How do you make every run the same?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Start fast and the same on every runner: --bare and the system prompt flags

Study: Start fast and the same on every runner: --bare and the system prompt flags Headless Settings precedence

Return to Foundations Mock Exam 2 · Q633's situation and clause-by-clause explanation

Scenario 4 · Structured Data Extraction

D3 · Prompting & Structured Output

Q634. The vehicle_vin field comes back null for 22% of repair estimates produced by three body-shop software packages, although a human can see the VIN on every estimate. These packages put it in a stamped box labelled 'VEH ID', or in the right column of a two-column header. The prompt already says to extract the vehicle identification number. What change would most effectively reduce these null results? (Select ONE.) A) Retry each estimate with a null VIN up to three times using the same prompt, and keep the first non-null value returned. B) Add a few examples showing correct VIN extraction from a 'VEH ID' stamp and from a two-column header layout. C) Add one sentence telling Claude that the VIN can appear under other labels and in other positions on a repair estimate. D) Make the vehicle_vin field required in the extraction schema, so Claude must always return a VIN for every repair estimate.

Understand Foundations Mock Exam 2 · Q634 · the situation and each part of the question

The real situation behind this question

Northfield Mutual's extraction misses the vehicle identification number on many repair estimates from three body-shop software packages. Reviewers can see the VIN easily: one package stamps it in a box, another puts it in a side column. Missing VINs block claim matching and need manual entry. The prompt already asks for the VIN, so the team needs a change that teaches Claude these layouts.

Read the question in parts

Part 1 · produced by three body-shop software packages

the failures cluster on specific layouts, which examples can target.

Part 2 · The prompt already says to extract the vehicle identification number

the instruction exists; what is missing is a demonstration of unusual layouts.

What you are being asked to decide

The VIN is on the page, but Claude misses it in unusual layouts. What helps most? Tests few-shot examples for extraction from varied document formats.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Few-shota few worked examples in the prompt that show where the VIN sits in each layout
Schema missing valueshow the schema treats information that is absent, which is not the problem here

Study: Few-shot examples for ambiguous cases and varied documents Few-shot Schema missing values

Understand Foundations Mock Exam 2 · Q634's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The value is present but in unfamiliar layouts. Few-shot examples of those exact layouts teach Claude where to look; required fields or general sentences do not.

Connect the design to the situation

A 'VEH ID' stamp holds the VIN, and Claude returns null.

Best answer: B. Few-shot examples that show extraction from varied document structures are the most effective fix for required information returned as empty. A required field forces a value even where none is visible, which invites fabricated VINs, and a general sentence does not show Claude what these specific layouts look like.

The decisive evidence in the stem

a human can see the VIN on every estimate The information is present, so the problem is recognizing unfamiliar layouts, which examples of those layouts address.

Official objective tested: Task 4.2 · Apply few-shot prompting to improve output consistency and quality

What each choice would do here

A · Why this does not meet the full requirement

Retry each estimate with a null VIN up to three times using the same prompt, and keep the first non-null value returned.

The same prompt fails the same way, and retries waste calls.

Each retry reads the same layout with the same prompt and usually returns null again. Costs triple for those estimates, and the null rate barely moves.

B · Why this meets the requirement

Add a few examples showing correct VIN extraction from a 'VEH ID' stamp and from a two-column header layout.

Shows Claude what these layouts look like and where the value sits.

The prompt now includes two short examples: a stamped 'VEH ID: 1FTFW1E50NFA12345' box mapped to vehicle_vin, and a two-column header with the VIN on the right. Null rates for those three packages fall sharply.

C · Why this does not meet the full requirement

Add one sentence telling Claude that the VIN can appear under other labels and in other positions on a repair estimate.

Too general to teach the specific layouts Claude is missing.

Claude knows labels vary but still does not recognize a stamped box as the VIN field. Null rates improve only slightly for the three software packages.

D · Why this does not meet the full requirement

Make the vehicle_vin field required in the extraction schema, so Claude must always return a VIN for every repair estimate.

Forces values even when unsure, which risks fabricated VINs.

Claude now returns a VIN for every estimate, sometimes a part number or a claim number when it cannot find one. Nulls disappear, but wrong VINs attach repairs to the wrong vehicles.

Check your understanding · explain the design in your own words

The VIN is on the page, but Claude misses it in unusual layouts. What helps most?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Few-shot examples for ambiguous cases and varied documents

Study: Few-shot examples for ambiguous cases and varied documents Few-shot Schema missing values

Return to Foundations Mock Exam 2 · Q634's situation and clause-by-clause explanation

D5 · Context & Reliability

Q635. For one auto claim, the body shop's repair estimate states a total of 41,200 USD, while the line amounts in the adjuster's damage assessment add up to 39,800 USD. The pipeline currently keeps the estimate total and drops the adjuster figure without noting the difference. Regulators audit claim payments for overpayment. How should the extraction handle such conflicts? (Select ONE.) A) Record the average of the two values, so that the claim amount sits between the estimate figure and the adjuster's figure. B) Always keep the larger of the two values, since paying the higher amount is the safer choice when customer complaints are involved. C) Keep the value from whichever document has the later issue date, since the more recent document is the most likely to be correct. D) Record both values with source document and page, set a conflict flag, and let a reviewer or reconciliation step decide.

Understand Foundations Mock Exam 2 · Q635 · the situation and each part of the question

The real situation behind this question

Northfield Mutual's documents sometimes disagree. In one auto claim, the body shop's estimate and the adjuster's assessment give different totals, perhaps because of a rental charge, a missing line, or a typo. The pipeline quietly keeps the estimate figure, and nobody sees the mismatch. Regulators audit for overpayment, so the team needs conflicts like this surfaced with enough information to resolve them properly. Silence is the problem.

Read the question in parts

Part 1 · the line amounts in the adjuster's damage assessment add up to 39,800 USD

a second credible source disagrees, which is evidence that must be preserved, not discarded.

Part 2 · Regulators audit claim payments for overpayment

a wrong silent choice has a real cost, so the decision needs review.

What you are being asked to decide

Two documents disagree on the claim amount. Should the extraction pick one, or keep both? Tests preserving conflicting values with source attribution instead of choosing arbitrarily.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Provenancewhich document and page each value came from
Audit trailthe record showing both values and who decided which one was paid

Study: Provenance — claim-source mappings through synthesis Provenance Audit trail

Understand Foundations Mock Exam 2 · Q635's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Two credible sources disagree, and a silent choice risks wrong payments. Keep both values with their sources, flag the conflict, and let an authorized step decide.

Connect the design to the situation

The estimate says 41,200 USD, the adjuster's lines add up to 39,800 USD.

Best answer: D. When credible sources conflict, the extraction should preserve both values with their sources and flag the conflict, so the decision is made deliberately by a step that has authority to make it. Choosing the larger value is a fixed heuristic that hides the conflict, and overpayment has its own consequences.

The decisive evidence in the stem

drops the adjuster figure without noting the difference The current design silently resolves a conflict, losing the information a reconciler needs to make the right decision.

Official objective tested: Task 5.6 · Preserve information provenance and handle uncertainty in multi-source synthesis

What each choice would do here

A · Why this does not meet the full requirement

Record the average of the two values, so that the claim amount sits between the estimate figure and the adjuster's figure.

Produces a value that neither document states.

The pipeline pays 40,500, a number that appears in neither document. Auditors cannot match it to any paperwork, which raises more questions than either original value.

B · Why this does not meet the full requirement

Always keep the larger of the two values, since paying the higher amount is the safer choice when customer complaints are involved.

A fixed rule hides the conflict and can still pay the wrong amount.

The pipeline pays 41,200 every time. Where the higher figure includes a charge the policy does not cover, the claim is overpaid, and the audit finds it.

C · Why this does not meet the full requirement

Keep the value from whichever document has the later issue date, since the more recent document is the most likely to be correct.

Recency does not show which value is correct and still hides the conflict.

The adjuster report was issued a day later, so 39,800 is paid. If the later document simply omitted a covered line, the customer is underpaid, and nobody saw the conflict.

D · Why this meets the requirement

Record both values with source document and page, set a conflict flag, and let a reviewer or reconciliation step decide.

Keeps both values with sources, so the conflict is resolved deliberately and traceably.

The record shows claim_amount candidates: 41,200 from estimate page 1 and 39,800 from the adjuster report page 2, with conflict_detected true. The reconciliation step finds a 1,400 rental-car charge included only in the estimate and pays the correct amount with a note.

Check your understanding · explain the design in your own words

Two documents disagree on the claim amount. Should the extraction pick one, or keep both?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Provenance — claim-source mappings through synthesis

Study: Provenance — claim-source mappings through synthesis Provenance Audit trail

Return to Foundations Mock Exam 2 · Q635's situation and clause-by-clause explanation

D3 · Prompting & Structured Output

Q636. To cut costs, Northfield wants to move extraction to the Message Batches API, which can take up to 24 hours to process a batch. Each new claim must have an initial reserve within 36 hours of its first document's arrival, and validation plus human review need up to 4 hours after extraction. Documents arrive steadily all day. How often should the application submit batches? (Select ONE.) A) Once a day at midnight, so that each batch contains a full day of documents and is as large and as cheap as possible. B) Every 12 hours, so each batch is large and the 24-hour processing window plus the wait before submission fits the deadline. C) Every 6 hours, so the worst-case wait plus 24 hours of processing and 4 hours of review stays within 36. D) Use the synchronous Messages API for every document, since any batch schedule risks missing the 36-hour reserve deadline.

Understand Foundations Mock Exam 2 · Q636 · the situation and each part of the question

The real situation behind this question

Northfield Mutual wants the cost savings of batch processing for its 25,000 daily claim documents. The catch is the reserve deadline: 36 hours from a claim's first document to an initial reserve. Batch processing can take up to a day, and reviewers need time after extraction. The architect must choose a submission schedule that keeps the savings without ever missing the deadline, even in the worst case.

Read the question in parts

Part 1 · can take up to 24 hours to process a batch

the processing time has no latency guarantee, so planning must assume the maximum.

Part 2 · Documents arrive steadily all day

some document always arrives just after a submission, so the worst case is a full interval of waiting.

What you are being asked to decide

Batches take up to 24 hours and reserves are due in 36. How often must batches be sent? Tests calculating batch submission frequency from an SLA and the batch processing window.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Batch APIthe Message Batches API, cheaper but with up to 24 hours of processing and no latency guarantee
SLA designworking backwards from the 36-hour reserve deadline to the submission schedule

Study: Message Batches API — the cost/latency lever (tested by contract) Batch API SLA design

Understand Foundations Mock Exam 2 · Q636's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Worst case = submission interval + 24 hours of processing + 4 hours of review. Only a 6-hour interval keeps that within 36 hours while keeping batch pricing.

Connect the design to the situation

A document arriving right after a submission must still lead to a reserve within 36 hours.

Best answer: C. The worst case is a document arriving just after a submission: it waits one full interval, then up to 24 hours of processing, then up to 4 hours of review. With 6-hour intervals that totals 34 hours, inside 36. Twelve-hour intervals give 40 hours, which misses the deadline.

The decisive evidence in the stem

validation plus human review need up to 4 hours after extraction The review time must be added to the worst-case wait and the 24-hour processing time when choosing the submission interval.

Official objective tested: Task 4.5 · Design efficient batch processing strategies

What each choice would do here

A · Why this does not meet the full requirement

Once a day at midnight, so that each batch contains a full day of documents and is as large and as cheap as possible.

Worst case 24 + 24 + 4 = 52 hours, far past the deadline.

A document arriving at 00:01 waits a full day before submission, then up to a day of processing. Many reserves would be a day late, and regulators notice.

B · Why this does not meet the full requirement

Every 12 hours, so each batch is large and the 24-hour processing window plus the wait before submission fits the deadline.

Worst case 12 + 24 + 4 = 40 hours, which misses the deadline.

A document arriving just after a submission waits 12 hours, then up to 24 hours of processing, then 4 hours of review: 40 hours. On slow batch days, reserves are late.

C · Why this meets the requirement

Every 6 hours, so the worst-case wait plus 24 hours of processing and 4 hours of review stays within 36.

Worst case 6 + 24 + 4 = 34 hours, within the 36-hour deadline.

A document arriving at 06:01 waits until the 12:00 submission, is processed by 12:00 the next day at the latest, and is reviewed by 16:00. That is 34 hours, inside the deadline, and every document still gets batch pricing.

D · Why this does not meet the full requirement

Use the synchronous Messages API for every document, since any batch schedule risks missing the 36-hour reserve deadline.

Meets the deadline but gives up savings that a correct schedule keeps.

Every reserve is on time, but Northfield pays full price for all 25,000 documents a day. A schedule that respects the deadline would have kept the savings.

Check your understanding · explain the design in your own words

Batches take up to 24 hours and reserves are due in 36. How often must batches be sent?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Message Batches API — the cost/latency lever (tested by contract)

Study: Message Batches API — the cost/latency lever (tested by contract) Batch API SLA design

Return to Foundations Mock Exam 2 · Q636's situation and clause-by-clause explanation

D5 · Context & Reliability

Q637. On a labelled sample, overall field accuracy is 97%. Management proposes that extractions the model marks as high-confidence skip human review entirely, freeing the six reviewers for other work. You must protect claim payments from undetected errors. Which TWO steps should accompany this change? (Select TWO.) A) Rely on the 97% overall figure, since it exceeds the 95% target, and apply the change to every document type at the same time. B) Keep reviewing a stratified random sample of high-confidence extractions on an ongoing basis to measure error rates and spot new error patterns. C) Measure accuracy separately by document type and by field, and automate only the segments that meet the target on their own. D) Once the change is live, review only extractions marked low-confidence, and stop sampling the high-confidence group because it was already validated.

Understand Foundations Mock Exam 2 · Q637 · the situation and each part of the question

The real situation behind this question

Northfield Mutual's extraction looks accurate overall, and management wants to free its six reviewers by skipping review for high-confidence results. But payment errors are costly, and the documents vary widely: clean typed claim forms, scanned repair estimates, handwritten witness statements. The architect must decide what to check before and after reducing review so that hidden errors do not reach claim payments. Both checks have a cost.

Read the question in parts

Part 1 · skip human review entirely

removing review needs evidence for every segment and a way to keep watching afterwards.

Part 2 · protect claim payments from undetected errors

the priority is catching hidden and new errors, not maximizing automation.

What you are being asked to decide

97% overall sounds good. What two checks keep high-confidence automation safe? Tests segment-level accuracy analysis and ongoing stratified sampling before reducing human review.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Stratified samplingreviewing a random sample from each document type, including high-confidence ones
Calibrationchecking that 'high confidence' really means high accuracy for each segment

Study: Confidence calibration & stratified sampling (human-review routing) Stratified sampling Calibration HITL

Understand Foundations Mock Exam 2 · Q637's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Aggregate accuracy hides weak segments, and accuracy can drift. Check accuracy by document type and field before automating, and keep stratified sampling of high-confidence output afterwards.

Connect the design to the situation

Handwritten witness statements may be far below 97% while typed claim forms are near perfect.

Best answer: BC. An overall 97% can hide much weaker accuracy on one document type or field, so each segment must be checked before automating it. After automation, ongoing stratified sampling of high-confidence extractions measures real error rates and detects new patterns. Stopping sampling removes the only way to notice when high-confidence output degrades.

The decisive evidence in the stem

overall field accuracy is 97% An aggregate figure can mask poor performance in specific segments, so it cannot justify automation by itself.

Official objective tested: Task 5.5 · Design human review workflows and confidence calibration

What each choice would do here

A · Why this does not meet the full requirement

Rely on the 97% overall figure, since it exceeds the 95% target, and apply the change to every document type at the same time.

The aggregate can hide a document type that performs far worse.

All types are automated. Damage amounts on handwritten statements, at 88%, go unreviewed, and wrong amounts reach claim payments for weeks before anyone notices. The average hid them.

B · Why this does not meet the full requirement

Keep reviewing a stratified random sample of high-confidence extractions on an ongoing basis to measure error rates and spot new error patterns.

Keeps measuring real error rates and catches new error patterns over time.

Each week, reviewers check a random sample of high-confidence extractions from every document type. When a body-shop package changes its layout, the sample shows a jump in errors within days.

C · Why this does not meet the full requirement

Measure accuracy separately by document type and by field, and automate only the segments that meet the target on their own.

Finds weak segments that the overall number hides before they are automated.

The breakdown shows typed claim forms at 99.2% but handwritten damage amounts on witness statements at 88%. The team automates claim forms first and keeps review for handwritten statements until their accuracy improves.

D · Why this does not meet the full requirement

Once the change is live, review only extractions marked low-confidence, and stop sampling the high-confidence group because it was already validated.

Removes the only signal that high-confidence output has started to fail.

High-confidence results are never checked again. When a new estimate format confuses the model while confidence stays high, errors flow to payments unseen. Nothing raises an alarm.

Check your understanding · explain the design in your own words

97% overall sounds good. What two checks keep high-confidence automation safe?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Confidence calibration & stratified sampling (human-review routing)

Study: Confidence calibration & stratified sampling (human-review routing) Stratified sampling Calibration HITL

Return to Foundations Mock Exam 2 · Q637's situation and clause-by-clause explanation

D3 · Prompting & Structured Output

Q638. For about 30% of medical bills, validation fails because provider_tax_id is missing. The pipeline retries each one three times with the validation error appended, and every retry still fails. Investigation shows that for these clinics the tax ID appears only in a separate assignment-of-benefits form, which is never sent to the extractor. What should change? (Select ONE.) A) Mark provider_tax_id as required in the schema, so that the model must provide a value before the extraction can be accepted. B) Add few-shot examples showing where the provider tax ID usually appears on medical bills from the most common clinics. C) Increase the retries to six and make the appended error message more detailed, so that the model searches the bill more carefully. D) Stop retrying these cases: return the field as missing with a reason, and route the bill to fetch the assignment-of-benefits form.

Understand Foundations Mock Exam 2 · Q638 · the situation and each part of the question

The real situation behind this question

Northfield Mutual's pipeline retries any extraction that fails validation, and that usually works. But one group of medical bills fails every time on the provider's tax ID. An engineer discovers why: for these clinics, the tax ID is only in a separate assignment-of-benefits form that the pipeline never sends. The retries cost money and delay payments without any chance of success.

Read the question in parts

Part 1 · every retry still fails

repeated failure with error feedback suggests a problem retries cannot fix.

Part 2 · appears only in a separate assignment-of-benefits form

the missing value lives outside the input, which defines the limit of retry.

What you are being asked to decide

Retries keep failing because the value lives in another document. What should the pipeline do? Tests recognizing when retries are ineffective because information is absent from the source.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Validation repairretrying with error feedback, which only works when the source contains the answer
Schema missing valuesreporting the tax ID as absent with a reason instead of inventing it

Study: Validation, retry, and feedback loops: when a retry can fix it Validation repair Schema missing values

Understand Foundations Mock Exam 2 · Q638's answer · full reasoning and worked examples
Claude synthesized · the point, straight

A retry can fix a misreading, not missing input. When the value lives in a document that was never sent, record the absence and fetch the right document.

Connect the design to the situation

A tax ID that exists only in an assignment-of-benefits form that is never sent.

Best answer: D. Retries work when the information is in the source and was misread; they cannot work when the information is in a document the model never receives. Recording the absence and getting the right document is the only path to a correct value. Making the field required would force a fabricated tax ID.

The decisive evidence in the stem

which is never sent to the extractor The value is not in the input at all, so no amount of retrying or prompting can produce it correctly.

Official objective tested: Task 4.4 · Implement validation, retry, and feedback loops for extraction quality

What each choice would do here

A · Why this does not meet the full requirement

Mark provider_tax_id as required in the schema, so that the model must provide a value before the extraction can be accepted.

Forces a value that does not exist, inviting a fabricated tax ID.

Claude must now supply a value, so it may use the clinic's phone number or another number on the page. Wrong tax IDs reach payment and tax reporting.

B · Why this does not meet the full requirement

Add few-shot examples showing where the provider tax ID usually appears on medical bills from the most common clinics.

Examples help find information that exists, not information that is elsewhere.

The examples show tax IDs on bills that have them. For these bills, Claude still cannot find a value that is not printed, and may start mistaking other numbers for it.

C · Why this does not meet the full requirement

Increase the retries to six and make the appended error message more detailed, so that the model searches the bill more carefully.

More retries cannot find information that is not in the input.

Six retries now fail instead of three, doubling cost and delay. The bill still does not contain the tax ID, so the result is the same.

D · Why this meets the requirement

Stop retrying these cases: return the field as missing with a reason, and route the bill to fetch the assignment-of-benefits form.

Stops wasted retries and gets the document that actually holds the value.

The extraction returns provider_tax_id null with reason 'not present on bill'. The pipeline requests the assignment-of-benefits form, extracts the tax ID from it, and completes the record. No more doomed retries.

Check your understanding · explain the design in your own words

Retries keep failing because the value lives in another document. What should the pipeline do?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Validation, retry, and feedback loops: when a retry can fix it

Study: Validation, retry, and feedback loops: when a retry can fix it Validation repair Schema missing values

Return to Foundations Mock Exam 2 · Q638's situation and clause-by-clause explanation

D3 · Prompting & Structured Output

Q639. A nightly batch of 18,000 archived claim documents completes with 210 failed requests. Their errors show the inputs exceeded the context limit: they are complete hospital records of 150 pages or more. Each request was submitted with a custom_id equal to the document ID. How should the team handle these failures? (Select ONE.) A) Resubmit only the 210 failed documents, identified by custom_id, after splitting each record into page ranges that fit. B) Resubmit the 210 failed documents with a higher max_tokens value, so that the model has enough room for the long record output. C) Resubmit the 210 failed documents unchanged in a new batch, since batch failures are often temporary and may succeed on a second try. D) Resubmit the whole batch of 18,000 documents the next night, so that all results come from one consistent processing run.

Understand Foundations Mock Exam 2 · Q639 · the situation and each part of the question

The real situation behind this question

Northfield Mutual runs a nightly batch to extract data from archived claim documents for loss analytics. Most requests succeed, but 210 fail. The errors are clear: the inputs, long hospital records from injury claims, are too big for the context limit. Because every request carried the document ID as its custom_id, the team knows exactly which documents failed and must decide how to resubmit them.

Read the question in parts

Part 1 · with a custom_id equal to the document ID

each failure can be traced to its exact document, enabling a targeted resubmission.

Part 2 · complete hospital records of 150 pages or more

the failing inputs share a cause, length, that chunking addresses.

What you are being asked to decide

210 of 18,000 batch requests failed because the documents were too long. What do you resubmit, and how? Tests resubmitting only failed batch items by custom_id with an appropriate fix.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Batch APIthe Message Batches API, where each request carries a custom_id to match results to inputs
Chunking strategysplitting a long hospital record into page ranges that fit within the context limit

Study: Message Batches API — the cost/latency lever (tested by contract) Batch API Chunking strategy

Understand Foundations Mock Exam 2 · Q639's answer · full reasoning and worked examples
Claude synthesized · the point, straight

custom_id identifies exactly which documents failed, and the error names the cause. Resubmit only those documents, chunked to fit the context limit.

Connect the design to the situation

Long hospital records overflow the context limit in a nightly batch.

Best answer: A. custom_id lets the team match each failure to its document and resubmit only those, and the error says the input was too large, so the fix is chunking the records. Resubmitting unchanged repeats the same failure, and max_tokens limits output length, not input size.

The decisive evidence in the stem

the inputs exceeded the context limit The failure is caused by input size, so the resubmission must change the input, not simply repeat it.

Official objective tested: Task 4.5 · Design efficient batch processing strategies

What each choice would do here

A · Why this meets the requirement

Resubmit only the 210 failed documents, identified by custom_id, after splitting each record into page ranges that fit.

Fixes the cause and resubmits only what failed.

The team selects the 210 failed custom_ids, splits each record into 40-page ranges with a shared header, and submits them in a new batch. Results are joined back to the document ID, and the archive is complete the next day.

B · Why this does not meet the full requirement

Resubmit the 210 failed documents with a higher max_tokens value, so that the model has enough room for the long record output.

max_tokens limits output, not input size, so the error remains.

The model would have room for longer answers, but the input still does not fit. The requests fail with the same error before any output is produced.

C · Why this does not meet the full requirement

Resubmit the 210 failed documents unchanged in a new batch, since batch failures are often temporary and may succeed on a second try.

The same oversized inputs fail the same way again.

The 210 requests are submitted again exactly as before and fail again with the same context-limit error. A day is lost for nothing. Nothing about them changed.

D · Why this does not meet the full requirement

Resubmit the whole batch of 18,000 documents the next night, so that all results come from one consistent processing run.

Reprocesses 17,790 successful documents for no benefit.

The next night's batch costs as much as the first and fails on the same 210 records, because nothing about them changed. Successful results are simply produced twice.

Check your understanding · explain the design in your own words

210 of 18,000 batch requests failed because the documents were too long. What do you resubmit, and how?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Message Batches API — the cost/latency lever (tested by contract)

Study: Message Batches API — the cost/latency lever (tested by contract) Batch API Chunking strategy

Return to Foundations Mock Exam 2 · Q639's situation and clause-by-clause explanation

D5 · Context & Reliability

Q640. The six reviewers can check about 900 of the 25,000 daily claim documents. Today they pick documents at random, and most of what they check is already correct. The model can output a confidence score for each extracted field, and the team has 5,000 documents labelled by reviewers last quarter. How should review attention be routed? (Select ONE.) A) Route the longest documents to review first, since longer documents contain more fields and so are more likely to contain an error. B) Rotate review across repair shops alphabetically each day, so that every shop's documents receive the same amount of reviewer attention. C) Calibrate field-level confidence thresholds on the labelled documents, then route low-confidence fields and documents with conflicting sources to review first. D) Route documents to review by the model's document-level confidence score as it is produced, without comparing the scores to the labelled set.

Understand Foundations Mock Exam 2 · Q640 · the situation and each part of the question

The real situation behind this question

Northfield Mutual's six reviewers check about 4% of each day's claim documents. Picking at random means they spend most of their time confirming correct extractions while errors slip through elsewhere. The model can score its confidence per field, and the team has a labelled set from last quarter. The architect must design routing that makes the reviewers' limited time count. Capacity cannot grow.

Read the question in parts

Part 1 · most of what they check is already correct

random selection spends scarce reviewer capacity on extractions that were already right.

Part 2 · a confidence score for each extracted field

field-level scores allow targeted review, once their meaning is calibrated.

What you are being asked to decide

Reviewers can check only 900 documents a day. How do you pick which ones? Tests calibrated field-level confidence routing for limited reviewer capacity.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Calibrationmeasuring how often fields at each confidence score are actually correct, using the labelled documents
Golden setthe 5,000 reviewer-labelled documents used as the reference for accuracy

Study: Confidence calibration & stratified sampling (human-review routing) Calibration Golden set

Understand Foundations Mock Exam 2 · Q640's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Reviewer time is scarce, and raw confidence is not proof of accuracy. Calibrate field-level thresholds on the labelled set, then route low-confidence fields and conflicting documents first.

Connect the design to the situation

Random review spends most effort on extractions that were already right.

Best answer: C. Field-level confidence becomes useful for routing only after it is calibrated against labelled data, which shows what each score actually means for accuracy. Routing the lowest-confidence fields and contradictory documents puts limited reviewer time where errors are most likely. Raw, uncalibrated scores may not track accuracy at all.

The decisive evidence in the stem

the team has 5,000 documents labelled by reviewers last quarter A labelled set exists, so confidence thresholds can be calibrated against real accuracy before routing.

Official objective tested: Task 5.5 · Design human review workflows and confidence calibration

What each choice would do here

A · Why this does not meet the full requirement

Route the longest documents to review first, since longer documents contain more fields and so are more likely to contain an error.

Length is a weak proxy for error risk.

Long hospital records are reviewed first, though their typed fields are usually correct. Short, handwritten witness statements with frequent amount errors are rarely checked. Error risk is ignored.

B · Why this does not meet the full requirement

Rotate review across repair shops alphabetically each day, so that every shop's documents receive the same amount of reviewer attention.

Equal attention ignores where errors actually occur.

Each shop gets equal attention, including shops whose clean digital estimates almost never have errors. Shops with messy scans get no more review than anyone else.

C · Why this meets the requirement

Calibrate field-level confidence thresholds on the labelled documents, then route low-confidence fields and documents with conflicting sources to review first.

Spends review time where calibrated scores and source conflicts show errors are likely.

Calibration shows that damage-amount fields below 0.8 are wrong 30% of the time, while claim-form dates above 0.9 are wrong 0.5% of the time. Reviewers now see low-confidence amounts and files whose estimate and adjuster report disagree, and they catch far more errors per day.

D · Why this does not meet the full requirement

Route documents to review by the model's document-level confidence score as it is produced, without comparing the scores to the labelled set.

Uncalibrated scores may be high on wrong fields and low on right ones.

Some document types get high scores even when wrong, and others get low scores when right. Reviewers see a mix that is barely better than random, because nobody checked what the scores mean.

Check your understanding · explain the design in your own words

Reviewers can check only 900 documents a day. How do you pick which ones?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Confidence calibration & stratified sampling (human-review routing)

Study: Confidence calibration & stratified sampling (human-review routing) Calibration Golden set

Return to Foundations Mock Exam 2 · Q640's situation and clause-by-clause explanation

D3 · Prompting & Structured Output

Q641. Repair estimates must not be paid, but final repair invoices must be. Many documents are ambiguous: an 'INVOICE' header with 'subject to teardown, amounts not final' in the footer, or 'ESTIMATE' crossed out by hand. A two-page list of classification rules in the prompt still produces inconsistent results on these documents. What should the team add? (Select ONE.) A) Two to four examples of ambiguous documents, each showing the classification and the reasoning for choosing it over the other type. B) More rules covering each ambiguous pattern found so far, so that the classification list becomes complete for every known variation. C) Three classification runs per document with a majority vote, so the more frequent answer is used for each ambiguous document. D) A keyword rule that classifies a document as an estimate whenever the word 'estimate' appears anywhere in its text, whether or not crossed out.

Understand Foundations Mock Exam 2 · Q641 · the situation and each part of the question

The real situation behind this question

Northfield Mutual pays body shops on final repair invoices but never on estimates. Real documents blur the line: footers that say 'amounts not final', crossed-out headers, mixed wording. The team wrote two pages of rules, yet Claude classifies similar documents differently. A wrong classification either delays a payment the shop has earned or pays for work that was never confirmed. Consistency matters for every document.

Read the question in parts

Part 1 · 'ESTIMATE' crossed out by hand

a keyword alone cannot decide this case; judgment about the whole document is needed.

Part 2 · A two-page list of classification rules

the team already tried detailed instructions, which have not produced consistency.

What you are being asked to decide

Rules alone cannot sort tricky repair documents consistently. What should be added to the prompt? Tests few-shot examples with reasoning for ambiguous classification cases.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Few-shota few worked examples of tricky repair documents, each with the decision and its reason
Prompt templatethe structure of the extraction prompt, where the examples sit after the rules

Study: Few-shot examples for ambiguous cases and varied documents Few-shot Prompt template

Understand Foundations Mock Exam 2 · Q641's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Rules cannot list every ambiguous variation. Examples that show the decision and its reasoning teach judgment that generalizes to new cases.

Connect the design to the situation

'ESTIMATE' crossed out by hand on a final invoice that must be paid.

Best answer: A. Few-shot examples that show reasoning for ambiguous cases help the model generalize judgment to new variations, which detailed rules alone have not achieved. More rules only cover the patterns already seen, and a keyword rule misclassifies the crossed-out case.

The decisive evidence in the stem

still produces inconsistent results on these documents Detailed instructions have reached their limit on ambiguous cases, which is where examples with reasoning help most.

Official objective tested: Task 4.2 · Apply few-shot prompting to improve output consistency and quality

What each choice would do here

A · Why this meets the requirement

Two to four examples of ambiguous documents, each showing the classification and the reasoning for choosing it over the other type.

Demonstrates the judgment, so Claude can apply it to variations no rule describes.

One example shows an 'INVOICE' with 'subject to teardown, amounts not final' classified as an estimate, because the amounts are not yet confirmed. Another shows crossed-out 'ESTIMATE' with a completion date and payment terms classified as an invoice. Claude applies the same reasoning to new variants.

B · Why this does not meet the full requirement

More rules covering each ambiguous pattern found so far, so that the classification list becomes complete for every known variation.

Covers past patterns but not the next new variation.

The rules grow to four pages. The next shop uses 'preliminary, pending supplement', a pattern no rule covers, and results become inconsistent again. The list keeps growing.

C · Why this does not meet the full requirement

Three classification runs per document with a majority vote, so the more frequent answer is used for each ambiguous document.

Votes among inconsistent answers instead of making them consistent.

Three runs cost three times as much and still disagree on hard cases. The majority answer can be the wrong one when the prompt's guidance is unclear.

D · Why this does not meet the full requirement

A keyword rule that classifies a document as an estimate whenever the word 'estimate' appears anywhere in its text, whether or not crossed out.

Misclassifies documents where 'estimate' is crossed out or merely mentioned.

Final invoices with 'ESTIMATE' crossed out are classified as estimates and never paid. Shops wait weeks for money they are owed, which is worse than the inconsistency. The rule creates a new error.

Check your understanding · explain the design in your own words

Rules alone cannot sort tricky repair documents consistently. What should be added to the prompt?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Few-shot examples for ambiguous cases and varied documents

Study: Few-shot examples for ambiguous cases and varied documents Few-shot Prompt template

Return to Foundations Mock Exam 2 · Q641's situation and clause-by-clause explanation

D1 · Agentic Architecture

Q642. Northfield's new enrichment stage runs on the Claude Agent SDK and calls two community MCP servers that the company does not maintain. One returns storm event times as Unix timestamps and severities as numeric codes; the other returns policy coverage end times as ISO 8601 local times and text statuses. The agent sometimes compares the two formats wrongly and reports covered losses as outside the policy period. What should you implement? (Select ONE.) A) A PostToolUse hook that converts every timestamp to ISO 8601 UTC and every numeric code to a named value before the agent sees the result. B) A post-processing step that converts timestamps in the agent's final JSON output to UTC after the agent has finished its reasoning. C) A request to both community projects asking them to agree on one timestamp format and one status vocabulary in their next releases. D) A system prompt section explaining both timestamp formats and the numeric severity codes, so the agent converts them correctly while reasoning.

Understand Foundations Mock Exam 2 · Q642 · the situation and each part of the question

The real situation behind this question

Northfield Mutual's enrichment stage checks whether a storm loss happened while the customer's policy was active. It uses two open-source MCP servers that describe times in different ways. The agent sometimes compares a Unix timestamp with a local time and decides a loss fell outside coverage when it did not, which triggers wrong denial letters. The company cannot change the servers, so it must handle the formats itself.

Read the question in parts

Part 1 · that the company does not maintain

the fix cannot be made in the servers, so it belongs in Northfield's own harness.

Part 2 · returns policy coverage end times as ISO 8601 local times and text statuses

the two tools differ in both time format and code vocabulary, so both need normalizing.

What you are being asked to decide

Two tools return times and codes in different formats, and the agent mixes them up. Where do you fix the formats? Tests PostToolUse hooks that normalize heterogeneous tool results before the model reasons over them.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Hookcode that runs after each MCP tool returns and rewrites its result into one format
Deterministicevery result is converted the same way every time, with no reliance on the model's care

Study: Agent SDK hooks: block a call, clean up a result Hook Deterministic

Understand Foundations Mock Exam 2 · Q642's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The wrong comparisons happen during reasoning, over mixed formats. A PostToolUse hook normalizes every result before the agent sees it; prompts and output fixes act too weakly or too late.

Connect the design to the situation

A Unix timestamp compared with a local ISO time makes a covered storm loss look uncovered.

Best answer: A. A PostToolUse hook transforms tool results before the model processes them, so the agent always reasons over one consistent format. Prompt instructions make conversion probabilistic, and converting only the final output is too late, because the wrong comparisons happened during reasoning.

The decisive evidence in the stem

compares the two formats wrongly and reports covered losses as outside the policy period The error happens while the agent reasons over mixed formats, so the data must be normalized before the agent reads it.

Official objective tested: Task 1.5 · Apply Agent SDK hooks for tool call interception and data normalization

What each choice would do here

A · Why this meets the requirement

A PostToolUse hook that converts every timestamp to ISO 8601 UTC and every numeric code to a named value before the agent sees the result.

Normalizes every result in code before the agent reasons, so comparisons are always like for like.

After each MCP call, the hook turns 1767225600 into 2026-01-01T00:00:00Z, converts local times with their offset, and maps severity 3 to 'severe'. The agent sees one format and compares the loss time with the coverage period correctly.

B · Why this does not meet the full requirement

A post-processing step that converts timestamps in the agent's final JSON output to UTC after the agent has finished its reasoning.

Converts after the faulty comparison has already shaped the conclusion.

The final JSON has tidy timestamps, but the agent already concluded 'outside coverage' from a wrong comparison. Formatting the output does not repair a conclusion reached from mixed inputs.

C · Why this does not meet the full requirement

A request to both community projects asking them to agree on one timestamp format and one status vocabulary in their next releases.

Depends on outside projects and does not fix the problem now.

The projects may agree eventually, or never. Meanwhile, the agent keeps producing wrong coverage findings, and any new server added later brings its own format again.

D · Why this does not meet the full requirement

A system prompt section explaining both timestamp formats and the numeric severity codes, so the agent converts them correctly while reasoning.

Leaves conversion to the model on every call, which fails some of the time.

The agent converts correctly most of the time. But in a long run with many results it sometimes forgets a time zone or misreads a code, and wrong coverage decisions continue at a lower rate.

Walk through complete payloads or code · every step explained

Illustrative examples, not recorded live calls. Check each block's direction and endpoint: API requests, API responses, MCP messages, and configuration files are different contracts.

PostToolUse normalization (illustrative)

PYTHON
from datetime import datetime, timezone
SEVERITY = {1: 'minor', 2: 'moderate', 3: 'severe'}

def normalize(record):
    t = record.get('event_time')
    if isinstance(t, (int, float)):
        record['event_time'] = datetime.fromtimestamp(t, tz=timezone.utc).isoformat()
    if isinstance(record.get('severity'), int):
        record['severity'] = SEVERITY.get(record['severity'], 'unknown')
    return record

A PostToolUse hook applies a function like this to each MCP result before the agent reads it.

Which omitted settings use defaults or leave features unconfigured?

Check your understanding · explain the design in your own words

Two tools return times and codes in different formats, and the agent mixes them up. Where do you fix the formats?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Agent SDK hooks: block a call, clean up a result

Study: Agent SDK hooks: block a call, clean up a result Hook Deterministic

Return to Foundations Mock Exam 2 · Q642's situation and clause-by-clause explanation

D3 · Prompting & Structured Output

Q643. Extraction uses tool use with a strict schema, so every result is valid JSON. Business validation finds that in 4% of repair estimates the extracted line-item amounts do not add up to the extracted estimate total, usually because one line was read twice or skipped. Most of these source estimates are consistent when a reviewer checks them. What should the application do when this validation fails? (Select ONE.) A) Tighten the JSON schema with more constraints, so that line items that do not sum to the total are rejected as invalid output. B) Send a follow-up request with the original document, the failed extraction, and the specific error, such as 'lines sum to 1,240.00; total is 1,420.00'. C) Resend the original request unchanged, since a second attempt at the same extraction will often produce a different and correct reading. D) Set the temperature to 0 for all extraction requests, so that the model reads each estimate the same way and avoids random errors.

Understand Foundations Mock Exam 2 · Q643 · the situation and each part of the question

The real situation behind this question

Northfield Mutual's extractions are always valid JSON, but valid is not the same as correct. A small share of repair estimates come back with line items that do not match the total, usually from one line read twice or missed. The estimates themselves are fine. The team needs an automated way to fix these extractions before they reach the claims system and set the wrong reserve.

Read the question in parts

Part 1 · every result is valid JSON

syntax is already solved; the remaining errors are about the values.

Part 2 · usually because one line was read twice or skipped

the error is a reading slip that a targeted re-check can correct.

What you are being asked to decide

The JSON is valid, but the numbers do not add up. How should the application ask Claude to fix it? Tests retry with specific validation feedback for semantic extraction errors.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Validation repairsending the failed result and the exact error back so Claude can correct it
Structured outputsschema-shaped results that are always valid JSON but can still hold wrong values

Study: Validation, retry, and feedback loops: when a retry can fix it Validation repair Structured outputs

Understand Foundations Mock Exam 2 · Q643's answer · full reasoning and worked examples
Claude synthesized · the point, straight

Valid JSON can still hold wrong values, and these estimates are consistent. Retry with the document, the failed extraction and the exact validation error so Claude knows what to fix.

Connect the design to the situation

Lines sum to 1,240.00 while the extracted total is 1,420.00.

Best answer: B. The source data is consistent, so a retry can succeed, and specific error feedback tells the model exactly what to re-check. Strict schemas remove syntax errors but cannot express a semantic rule such as 'lines must sum to the total'. An unchanged retry gives the model no reason to read differently.

The decisive evidence in the stem

Most of these source estimates are consistent when a reviewer checks them The answer exists in the document, so a retry guided by the specific error has a good chance of correcting the extraction.

Official objective tested: Task 4.4 · Implement validation, retry, and feedback loops for extraction quality

What each choice would do here

A · Why this does not meet the full requirement

Tighten the JSON schema with more constraints, so that line items that do not sum to the total are rejected as invalid output.

Schemas check shape and types, not whether amounts add up.

JSON Schema can require numbers and arrays, but not that one field equals the sum of others. The extraction still passes the schema and still fails the business check.

B · Why this meets the requirement

Send a follow-up request with the original document, the failed extraction, and the specific error, such as 'lines sum to 1,240.00; total is 1,420.00'.

Gives Claude the document, its mistake and the exact rule broken, so it can re-read the right lines.

The follow-up says: 'Your extraction's lines sum to 1,240.00 but the total is 1,420.00. Re-check the line items against the document.' Claude finds the skipped 180.00 paint-labour line and returns a consistent result that passes validation.

C · Why this does not meet the full requirement

Resend the original request unchanged, since a second attempt at the same extraction will often produce a different and correct reading.

Gives no hint of what went wrong, so the same mistake is likely.

The second attempt reads the same layout the same way and often makes the same mistake. When it differs, nothing confirms it is correct, so the team still cannot trust it.

D · Why this does not meet the full requirement

Set the temperature to 0 for all extraction requests, so that the model reads each estimate the same way and avoids random errors.

Makes errors repeatable rather than fixing the misread line.

Every run on that estimate now skips the same line. The error becomes perfectly consistent and is never corrected. Determinism does not equal correctness, and the validation keeps failing.

Check your understanding · explain the design in your own words

The JSON is valid, but the numbers do not add up. How should the application ask Claude to fix it?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Validation, retry, and feedback loops: when a retry can fix it

Study: Validation, retry, and feedback loops: when a retry can fix it Validation repair Structured outputs

Return to Foundations Mock Exam 2 · Q643's situation and clause-by-clause explanation

D3 · Prompting & Structured Output

Q644. Northfield extracts deductibles and limits from 70-page commercial property policies with many endorsements. A single extraction pass over each whole policy misses deductibles defined in middle endorsements, and sometimes returns contradictory values, such as a 2% wind deductible in one field and 5% in another. How should the extraction be restructured? (Select ONE.) A) Extract each section or endorsement in its own focused pass, then run a separate integration pass that reconciles values across sections and flags conflicts. B) Add an instruction asking Claude to read every endorsement carefully and to make sure all deductible values agree before it answers. C) Move to a model with a larger context window, so the whole 70-page policy fits comfortably into one extraction pass with room to spare. D) Run the same single-pass extraction twice on each policy and keep the union of all deductibles found across the two runs.

Understand Foundations Mock Exam 2 · Q644 · the situation and each part of the question

The real situation behind this question

Northfield Mutual insures commercial buildings under policies of about 70 pages with many endorsements. Deductibles hide in the middle endorsements, and some are restated or overridden elsewhere. The current single-pass extraction misses some and reports conflicting values for others, so claims are paid against wrong deductibles. The team needs a structure that captures every deductible and resolves conflicts. Accuracy is the goal.

Read the question in parts

Part 1 · a 2% wind deductible in one field and 5% in another

the pass produces contradictions it does not resolve, which an integration pass handles.

Part 2 · A single extraction pass over each whole policy

the current design spreads attention over all 70 pages at once.

What you are being asked to decide

One pass over a long policy misses details and contradicts itself. How should the work be split? Tests multi-pass architecture: focused per-section passes plus a cross-section integration pass.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Long-context placementhow position in a long input affects what the model notices, such as middle endorsements
Chunking strategysplitting the policy by section so each pass reads a focused part

Study: Independent review and multi-pass review Long-context placement Chunking strategy

Understand Foundations Mock Exam 2 · Q644's answer · full reasoning and worked examples
Claude synthesized · the point, straight

One pass over 70 pages misses middle details and contradicts itself. Split into focused per-section passes, then run a separate integration pass to reconcile values across sections.

Connect the design to the situation

A wind deductible appears as 2% in one field and 5% in another.

Best answer: A. Large inputs dilute attention, so details in the middle are missed and findings contradict each other. Focused per-section passes catch local details, and a separate integration pass checks consistency across sections. Running the same single pass twice repeats the dilution and merges contradictions instead of resolving them.

The decisive evidence in the stem

misses deductibles defined in middle endorsements Details in the middle of a long input are being lost, which per-section passes address by keeping each pass focused.

Official objective tested: Task 4.6 · Design multi-instance and multi-pass review architectures

What each choice would do here

A · Why this meets the requirement

Extract each section or endorsement in its own focused pass, then run a separate integration pass that reconciles values across sections and flags conflicts.

Focused passes catch local details, and one integration pass resolves cross-section conflicts.

Each endorsement is extracted on its own, so the flood deductible in Endorsement F is found. An integration pass then sees 2% in the declarations and 5% in an endorsement dated later, and flags the endorsement as overriding.

B · Why this does not meet the full requirement

Add an instruction asking Claude to read every endorsement carefully and to make sure all deductible values agree before it answers.

An instruction cannot restore attention spread across 70 pages.

Claude tries harder, and results vary from run to run. The structural problem, one pass over a very long document, stays the same. Effort is not structure.

C · Why this does not meet the full requirement

Move to a model with a larger context window, so the whole 70-page policy fits comfortably into one extraction pass with room to spare.

Fitting more text in one pass does not fix diluted attention.

The policy already fits in context. A bigger window does not change how attention spreads across 70 pages, so middle endorsements are still missed and contradictions remain.

D · Why this does not meet the full requirement

Run the same single-pass extraction twice on each policy and keep the union of all deductibles found across the two runs.

Repeats the same weak pass and merges its contradictions.

The union contains more deductibles but also both the 2% and 5% values, plus any errors from either run. Nobody knows which value is current, and costs double.

Check your understanding · explain the design in your own words

One pass over a long policy misses details and contradicts itself. How should the work be split?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Independent review and multi-pass review

Study: Independent review and multi-pass review Long-context placement Chunking strategy

Return to Foundations Mock Exam 2 · Q644's situation and clause-by-clause explanation

D4 · Tools & MCP

Q645. Each extraction must start with extract_claim_metadata, which identifies the policy number, document type and loss date, because the enrichment tools lookup_policy_coverage and validate_provider_id need the policy number it returns. In about 9% of requests, Claude calls lookup_policy_coverage first with a guessed policy number. How should you configure the requests? (Select ONE.) A) Add a system prompt instruction that extract_claim_metadata must always be called first, before any enrichment tool is ever used. B) Force tool_choice to extract_claim_metadata on the first request, then use auto on the follow-up turns. C) Force tool_choice to extract_claim_metadata on every request in the conversation, so it always runs before anything else happens. D) Set tool_choice to "any" on every request, so Claude must call one of the tools instead of replying with plain text at any step.

Understand Foundations Mock Exam 2 · Q645 · the situation and each part of the question

The real situation behind this question

Northfield Mutual's extraction flow depends on order: first identify the document and the policy, then enrich with coverage details and provider checks. Sometimes Claude jumps ahead and looks up coverage with a policy number it guessed from a partial match, and wrong coverage limits reach the claims system. The team wants the first step guaranteed while keeping the later steps flexible. Wrong limits cost money on every affected claim.

Read the question in parts

Part 1 · need the policy number it returns

a later step depends on the first step's output, so the order is a hard requirement.

Part 2 · In about 9% of requests

the model usually gets the order right, but not reliably enough for a hard dependency.

What you are being asked to decide

One tool must always run first, but Claude sometimes skips it. How do you guarantee the order? Tests forced tool_choice for a required first step, then normal turns for later steps.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
tool_choicethe request setting that decides whether Claude may, must, or must use one specific tool
Forced tool extractionnaming one tool in tool_choice so Claude must call exactly that tool

Study: Tool choice: auto, any, or one forced tool tool_choice Forced tool extraction

Understand Foundations Mock Exam 2 · Q645's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The first step is a hard dependency the model sometimes skips. Force that one tool on the first request, then let later turns run normally so enrichment can follow.

Connect the design to the situation

Coverage is looked up with a guessed policy number before metadata is extracted.

Best answer: B. Forced tool selection guarantees that a specific tool runs first; the following steps then proceed in later turns. "any" guarantees a tool call but not which tool, so lookup_policy_coverage can still come first. Forcing the metadata tool on every turn would prevent the enrichment tools from ever running.

The decisive evidence in the stem

Claude calls lookup_policy_coverage first with a guessed policy number The ordering requirement is broken by the model's choice, so the first call must be fixed by configuration, not left to judgment.

Official objective tested: Task 2.3 · Distribute tools appropriately across agents and configure tool choice

What each choice would do here

A · Why this does not meet the full requirement

Add a system prompt instruction that extract_claim_metadata must always be called first, before any enrichment tool is ever used.

Guidance the model already ignores in 9% of requests.

The instruction reduces the problem a little, but the model still occasionally jumps ahead. Wrong coverage limits keep reaching the claims system in a smaller share of documents.

B · Why this meets the requirement

Force tool_choice to extract_claim_metadata on the first request, then use auto on the follow-up turns.

Guarantees the metadata call first and lets enrichment follow in later turns.

The first request sets tool_choice {"type": "tool", "name": "extract_claim_metadata"}. Claude returns the policy number. The application then sends the result with tool_choice auto, and Claude calls lookup_policy_coverage with the real policy number.

C · Why this does not meet the full requirement

Force tool_choice to extract_claim_metadata on every request in the conversation, so it always runs before anything else happens.

Locks every turn to the metadata tool, so enrichment never happens.

Every turn calls the metadata tool again. The enrichment tools are never chosen, so coverage and provider checks never run, and the extraction stalls. The pipeline never finishes.

D · Why this does not meet the full requirement

Set tool_choice to "any" on every request, so Claude must call one of the tools instead of replying with plain text at any step.

Requires some tool, but the wrong tool can still come first.

Claude must call a tool, and in some requests it still chooses lookup_policy_coverage with a guessed policy number. The order problem remains exactly where it was.

Walk through complete payloads or code · every step explained

Illustrative examples, not recorded live calls. Check each block's direction and endpoint: API requests, API responses, MCP messages, and configuration files are different contracts.

First request with a forced tool (illustrative)

JSON
{"model": "MODEL_ID", "max_tokens": 1024, "tools": [{"name": "extract_claim_metadata"}, {"name": "lookup_policy_coverage"}, {"name": "validate_provider_id"}], "tool_choice": {"type": "tool", "name": "extract_claim_metadata"}, "messages": [{"role": "user", "content": "<document text>"}]}

Tool definitions are shortened for the example. Later turns send the tool result with tool_choice auto.

Not supplied in this example · settings and defaults

context_management — not supplied here. No server compaction strategy is enabled by this body. Host/manual compaction is separate.

output_config — not supplied here. No output_config schema or effort override is supplied. A prompt asking for JSON does not provide schema enforcement.

system — not supplied here. No application system instructions are supplied through this field. User messages still provide task text.

stop_sequences — not supplied here. No custom stop strings are configured. Generation can still stop for end_turn, tool_use, max_tokens, or another documented reason.

stream — not supplied here. For a direct non-streaming create/parse call, the result is one message rather than an event stream. A stream helper configures this separately.

thinking — not supplied here. No explicit thinking override is shown. Behavior depends on the selected model; omission does not universally mean thinking is off.

cache_control — not supplied here. No top-level automatic cache marker is supplied. Check nested system/tool/content blocks for separate cache_control markers.

metadata — not supplied here. No application user reference is supplied through metadata. Authentication still comes from the request credentials.

Which omitted settings use defaults or leave features unconfigured?

Check your understanding · explain the design in your own words

One tool must always run first, but Claude sometimes skips it. How do you guarantee the order?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Tool choice: auto, any, or one forced tool

Study: Tool choice: auto, any, or one forced tool tool_choice Forced tool extraction

Return to Foundations Mock Exam 2 · Q645's situation and clause-by-clause explanation

D3 · Prompting & Structured Output

Q646. The medical bill schema marks diagnosis_code, the ICD-10 code for the injury, as required. About 18% of bills from small clinics do not list any diagnosis code. For these, Claude returns plausible-looking codes, and the medical review team has found several wrong ones on paid injury claims. What schema change addresses this? (Select ONE.) A) Keep diagnosis_code required and retry any bill whose code fails a format check, appending the format error to the retry request. B) Make diagnosis_code nullable, so Claude returns null when no code is shown, and route those bills to medical coders. C) Change diagnosis_code to an enum of the 200 codes Northfield sees most often, so Claude can choose only from codes known to be valid. D) Keep diagnosis_code required and add 'never guess a diagnosis code' to the prompt, so Claude leaves fewer invented values in the output.

Understand Foundations Mock Exam 2 · Q646 · the situation and each part of the question

The real situation behind this question

Northfield Mutual pays injury claims from extracted medical bill data. Many bills from small clinics have no diagnosis code at all. Because the schema requires one, Claude provides a code that looks right. Some of these reach paid claims and are wrong, which distorts reserves and fails audits. The medical review team wants missing codes flagged, not invented, so certified coders can assign them. Accuracy beats completeness here.

Read the question in parts

Part 1 · Claude returns plausible-looking codes

the model fills a required field with invented but believable values.

Part 2 · found several wrong ones on paid injury claims

the invented values reach paid claims, so fabrication is costly.

What you are being asked to decide

A required field makes Claude invent codes that are not on the bill. What do you change? Tests nullable schema fields to prevent fabrication when source data is absent.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Schema missing valueshow the schema lets Claude say 'not present' instead of inventing a value
JSON Schemathe definition of the extraction tool's fields, including which are required or nullable

Study: Schema design details that prevent hallucination (tested by name) Schema missing values JSON Schema

Understand Foundations Mock Exam 2 · Q646's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The codes are truly absent, and a required field forces an answer. Make the field nullable so Claude reports absence, and route those bills to coders.

Connect the design to the situation

A clinic bill without a diagnosis code gets a believable but wrong one.

Best answer: B. A required field pushes the model to supply a value even when the source has none, which produces fabricated codes. Making the field nullable lets Claude report absence honestly, and the application can route those bills. An enum of valid codes still forces a guess, only from a smaller list.

The decisive evidence in the stem

About 18% of bills from small clinics do not list any diagnosis code The information is truly absent, so the schema must allow an empty answer rather than demand a value.

Official objective tested: Task 4.3 · Enforce structured output using tool use and JSON schemas

What each choice would do here

A · Why this does not meet the full requirement

Keep diagnosis_code required and retry any bill whose code fails a format check, appending the format error to the retry request.

Fabricated codes pass format checks, so retries do not catch them.

An invented code such as S83.511A has a valid format and passes the check. No retry happens, and the wrong code is attached to the paid claim anyway. Retries never trigger.

B · Why this meets the requirement

Make diagnosis_code nullable, so Claude returns null when no code is shown, and route those bills to medical coders.

Lets absence be reported as null, so no code is invented and the right team assigns it.

The schema now allows "diagnosis_code": null. For a bill with no code, Claude returns null, and the application sends the bill to the medical coding queue. Paid claims contain only codes that appear on bills or were assigned by coders.

C · Why this does not meet the full requirement

Change diagnosis_code to an enum of the 200 codes Northfield sees most often, so Claude can choose only from codes known to be valid.

Still forces a choice, now from a list, for bills with no code at all.

Claude picks the closest of 200 codes for a bill with no code. The value is valid in format and often wrong in fact, and injuries outside the list are always misclassified.

D · Why this does not meet the full requirement

Keep diagnosis_code required and add 'never guess a diagnosis code' to the prompt, so Claude leaves fewer invented values in the output.

Asks the model to resist a schema that still demands a value.

Claude invents fewer codes, but the schema still requires one, so on some bills it still produces a plausible value. The review team keeps finding wrong codes, only less often.

Walk through complete payloads or code · every step explained

Illustrative examples, not recorded live calls. Check each block's direction and endpoint: API requests, API responses, MCP messages, and configuration files are different contracts.

Nullable field in the tool input schema (illustrative)

JSON
{"type": "object", "properties": {"diagnosis_code": {"type": ["string", "null"], "description": "ICD-10 code exactly as printed on the bill; null if the bill shows none"}}, "required": ["diagnosis_code"]}

The key stays present but may be null, so absence is reported explicitly rather than filled with a guess.

Which omitted settings use defaults or leave features unconfigured?

Check your understanding · explain the design in your own words

A required field makes Claude invent codes that are not on the bill. What do you change?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Schema design details that prevent hallucination (tested by name)

Study: Schema design details that prevent hallucination (tested by name) Schema missing values JSON Schema

Return to Foundations Mock Exam 2 · Q646's situation and clause-by-clause explanation

D3 · Prompting & Structured Output

Q647. Claim documents arrive in one shared upload queue, so their type is unknown. The application offers three extraction tools: extract_claim_form, extract_repair_estimate and extract_medical_bill. With tool_choice set to auto, about 5% of responses are plain text, such as 'This appears to be a police report with partial estimate data', which the parser cannot handle. What change guarantees structured output? (Select ONE.) A) Force tool_choice to extract_claim_form for every document, since claim forms are the most common document type in the queue. B) Keep auto and add a fallback parser that uses regular expressions to pull fields out of any plain-text responses Claude returns. C) Add a system prompt instruction that Claude must always respond by calling an extraction tool and must never answer in plain text. D) Set tool_choice to "any", so Claude must call one of the three extraction tools but still chooses the one that fits the document.

Understand Foundations Mock Exam 2 · Q647 · the situation and each part of the question

The real situation behind this question

Northfield Mutual receives claim documents through one upload queue with no reliable labels. Claude must decide which kind each one is and extract it with the matching tool. Most of the time it does, but sometimes it writes a comment instead, especially on unusual mixed documents. Those responses break the pipeline and need manual handling. The team wants structured output every time.

Read the question in parts

Part 1 · With tool_choice set to auto

auto lets the model answer in text, which explains the 5% of unparseable responses.

Part 2 · which the parser cannot handle

the downstream system needs a tool call every time, not most of the time.

What you are being asked to decide

Sometimes Claude writes text instead of calling an extraction tool. How do you require a tool call but let Claude pick which? Tests tool_choice any for guaranteed structured output when the document type is unknown.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
tool_choicethe setting where auto allows text, any requires some tool, and a named tool requires that tool
tool_usethe structured block Claude returns when it calls an extraction tool, which the parser expects

Study: Structured output — the engineering ladder tool_choice tool_use

Understand Foundations Mock Exam 2 · Q647's answer · full reasoning and worked examples
Claude synthesized · the point, straight

The type is unknown, so Claude must choose the schema, but text replies are not allowed. tool_choice "any" requires a tool call while keeping Claude's choice of tool.

Connect the design to the situation

A mixed police report gets a text comment instead of an extraction.

Best answer: D. tool_choice "any" requires a tool call while leaving the choice of tool to the model, which fits documents of unknown type. Forcing one specific tool would push repair estimates and medical bills into the claim-form schema. A prompt instruction only lowers the rate of text replies.

The decisive evidence in the stem

their type is unknown Claude must still choose the right schema, so the setting must require a tool without naming which one.

Official objective tested: Task 4.3 · Enforce structured output using tool use and JSON schemas

What each choice would do here

A · Why this does not meet the full requirement

Force tool_choice to extract_claim_form for every document, since claim forms are the most common document type in the queue.

Forces the claim-form schema onto documents of other types.

Every medical bill is pushed into the claim-form schema. Fields such as service codes come back empty or misplaced, and validation fails on a third of documents.

B · Why this does not meet the full requirement

Keep auto and add a fallback parser that uses regular expressions to pull fields out of any plain-text responses Claude returns.

Parses free text, which is fragile and returns unvalidated fields.

The fallback extracts some fields from free text, with no schema guarantees. Errors in those fields reach the claims system unnoticed, which is worse than a clear failure.

C · Why this does not meet the full requirement

Add a system prompt instruction that Claude must always respond by calling an extraction tool and must never answer in plain text.

Lowers the text rate but does not guarantee a tool call.

Text replies drop from 5% to perhaps 2%. The parser still meets plain text on unusual documents, and manual handling continues. The pipeline remains unreliable.

D · Why this meets the requirement

Set tool_choice to "any", so Claude must call one of the three extraction tools but still chooses the one that fits the document.

Requires a tool call and keeps Claude's choice of the right schema.

With tool_choice {"type": "any"}, the mixed police report now produces a call to the closest extraction tool, with uncertain fields left null. The parser always receives a tool_use block, and Claude still picks repair estimate or medical bill as needed.

Check your understanding · explain the design in your own words

Sometimes Claude writes text instead of calling an extraction tool. How do you require a tool call but let Claude pick which?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Structured output — the engineering ladder

Study: Structured output — the engineering ladder tool_choice tool_use

Return to Foundations Mock Exam 2 · Q647's situation and clause-by-clause explanation

D5 · Context & Reliability

Q648. A coordinator processes each claim file of 6 to 40 documents by sending every document to an extraction subagent. When the OCR service times out on one document, the subagent raises an exception and the coordinator aborts the whole claim file, discarding the other good extractions and delaying the reserve. How should errors flow instead? (Select ONE.) A) The subagent retries the transient failure; if it still fails, it returns a structured error naming the document, what was tried, and partial results. B) The subagent catches the exception and returns an empty extraction marked as successful, so the coordinator can finish the file without interruption. C) The subagent returns the message 'extraction unavailable' to the coordinator, which then marks that document for manual entry by a reviewer. D) The coordinator keeps aborting the file on any failure, but automatically restarts the entire claim file from the beginning after a short delay.

Understand Foundations Mock Exam 2 · Q648 · the situation and each part of the question

The real situation behind this question

Northfield Mutual processes each claim as a file of documents. The OCR service occasionally times out. Today, one timeout makes the subagent throw an exception, and the coordinator stops the entire claim file, discarding all the good work and delaying the initial reserve. The team needs errors to be handled in a way that saves good work and lets the coordinator decide sensibly.

Read the question in parts

Part 1 · the subagent raises an exception

the subagent neither recovers nor explains; it simply stops the flow.

Part 2 · discarding the other good extractions

a single failure destroys valid work, which is the cost of aborting.

What you are being asked to decide

One document's timeout kills the whole claim file. How should the error be handled and reported? Tests local recovery and structured error propagation instead of aborting or suppressing.

Keep all the stated requirements in view. An option may be useful elsewhere while addressing only part of this situation.

Words and related concepts · open glossary explanations
TermMeaning here
Error taxonomyclassifying the OCR timeout as transient, so a local retry makes sense
Graceful degradationfinishing the 39 good documents and reporting the one gap clearly

Study: Error propagation: what a subagent reports when it fails Error taxonomy Graceful degradation

Understand Foundations Mock Exam 2 · Q648's answer · full reasoning and worked examples
Claude synthesized · the point, straight

One failure should not destroy a claim file, and it should not be hidden. Recover locally from transient errors, and propagate unresolved ones with structured context so the coordinator keeps the good results.

Connect the design to the situation

One OCR timeout throws away 39 good extractions.

Best answer: A. Subagents should recover locally from transient failures and propagate only what they cannot resolve, with structured context so the coordinator can decide what to do while keeping the other results. Returning an empty result as success hides the failure and lets an incomplete claim file be processed as complete.

The decisive evidence in the stem

the coordinator aborts the whole claim file Terminating the whole workflow on one failure is an anti-pattern; the failure should be contained and reported with context.

Official objective tested: Task 5.3 · Implement error propagation strategies across multi-agent systems

What each choice would do here

A · Why this meets the requirement

The subagent retries the transient failure; if it still fails, it returns a structured error naming the document, what was tried, and partial results.

Fixes transient failures locally and gives the coordinator the context to handle the rest.

The subagent retries OCR twice with backoff; the second retry succeeds for most timeouts. When it does not, it returns {type: 'ocr_timeout', document: 'EST-4471', attempted: '3 OCR calls', partial: 'page 1 text'}. The coordinator finishes the other documents and requests a rescan.

B · Why this does not meet the full requirement

The subagent catches the exception and returns an empty extraction marked as successful, so the coordinator can finish the file without interruption.

Hides the failure, so an incomplete claim file can be processed as complete.

The claim file completes, and the missing repair estimate looks like an empty document. The reserve is set too low, and the error surfaces only weeks later at payment.

C · Why this does not meet the full requirement

The subagent returns the message 'extraction unavailable' to the coordinator, which then marks that document for manual entry by a reviewer.

A generic message hides what failed and what was tried.

A reviewer receives 'extraction unavailable' with no detail. They do not know whether the scan was bad, the service was down, or a retry might work, so they start from scratch.

D · Why this does not meet the full requirement

The coordinator keeps aborting the file on any failure, but automatically restarts the entire claim file from the beginning after a short delay.

Still throws away good work and may fail again on the same document.

The claim file restarts and processes all good documents again. If the OCR problem continues, it aborts again, and the reserve keeps slipping. The delay grows with each restart.

Check your understanding · explain the design in your own words

One document's timeout kills the whole claim file. How should the error be handled and reported?

Describe the situation, identify the controlling requirement, and explain what the chosen design does before and after the critical step. Then choose one alternative and explain which part of this situation it fails to address. Use the example rather than memorizing the answer letter.

Study: Error propagation: what a subagent reports when it fails

Study: Error propagation: what a subagent reports when it fails Error taxonomy Graceful degradation

Return to Foundations Mock Exam 2 · Q648's situation and clause-by-clause explanation