Courseiva

CCAR-F Prompt Engineering and Structured Output Practice Question

You are designing a prompt that asks Claude to review a pull request and return findings in a strict XML structure with a severity attribute for each finding. Your parser depends on the structure being consistent. Which TWO techniques most directly improve the consistency of the XML output? (Choose two.)

⚠ Common exam trap

The trap here is assuming that improving the model's reasoning or readability will also improve structural consistency, when only explicit format specification and examples constrain the XML shape.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Describe the required tags and attributes precisely in the instructions, specifying allowed severity values.

Consistency in structured output comes from removing ambiguity. A concrete example shows the exact shape, and precise instructions define tags and allowed attribute values. Together they constrain the model to a stable format. Step-by-step reasoning, high temperature, and Markdown lists either do not enforce structure or actively introduce variation, so they do not meet the parser's needs in this scenario.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Ask the model to return the findings as a Markdown bulleted list for readability.

    Why it's wrong here

    Markdown lists do not carry the severity attribute or the nested structure the parser expects. In this scenario, this format would fail parsing and lose the required metadata. Readability for humans is not the goal when a downstream system consumes the output. This choice conflicts with the stated XML requirement.

  • ✗

    Set the temperature to a high value so the model explores different XML layouts.

    Why it's wrong here

    Higher temperature increases variation, which is the opposite of what a strict parser needs. In this scenario, diverse layouts would break parsing and make findings harder to consume. Exploration is useful for creative tasks, not for fixed structural contracts. This setting would actively harm output consistency.

  • ✗

    Instruct the model to think step by step before producing the XML.

    Why it's wrong here

    Step-by-step reasoning can improve analysis quality, but it does not guarantee XML structure. In fact, it may add prose before the XML unless the instructions explicitly separate reasoning from output. In this scenario, the parser needs consistent tags, not better reasoning. This technique addresses a different problem than output consistency.

  • ✓

    Describe the required tags and attributes precisely in the instructions, specifying allowed severity values.

    Why this is correct

    Explicit, precise instructions define the contract the model must follow. In this scenario, naming the tags and enumerating allowed severity values removes ambiguity about what to emit. Clear specifications complement examples and reduce structural drift. This is a direct lever for making the XML consistent enough for a parser.

  • ✓

    Provide a short example of the exact XML structure expected, including the severity attribute.

    Why this is correct

    A concrete example anchors the model to the exact tags and attributes you need. In this scenario, showing a sample finding with a severity attribute makes the required shape unambiguous. Examples are especially effective for structural requirements like nested tags and attribute names. This directly reduces variation in the output format that the parser depends on.

About these practice questions

One of 271 original CCAR-F practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Anthropic exam blueprint

This CCAR-F practice question is part of Courseiva's free Anthropic certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CCAR-F exam.