Courseiva

CCAO-F Prompting and Context Engineering Practice Question

Exhibit

{
  "model": "claude-3-5-sonnet-20240620",
  "max_tokens": 200,
  "messages": [
    {
      "role": "user",
      "content": "Extract the user's name from this email: <email>From: John Doe <jdoe@example.com>...</email>"
    },
    {
      "role": "assistant",
      "content": "{ "name": ""
    }
  ]
}

Refer to the exhibit. This request uses a technique to force Claude to output valid JSON. What is the technical name for this technique, and what is its primary benefit?

⚠ Common exam trap

Candidates attempt to force JSON output using only system instructions, which often fails to prevent conversational filler, rather than using the 'Response Prefilling' technique to dictate the exact start.

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

✓

Response Prefilling; it eliminates conversational filler and ensures correct formatting.

The technique shown is 'prefilling the assistant response.' By starting the assistant's turn with the beginning of a JSON object, the developer forces Claude to continue the pattern. This is the most reliable way to ensure the output starts exactly with the required characters for programmatic parsing, bypassing any conversational preamble.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Few-shotting; it provides a single example of the JSON format to follow.

    Why it's wrong here

    Few-shotting requires full input-output pairs as examples. In this case, we are not giving an example but actually starting the model's final response for it. While it helps with formatting, 'prefilling' is the specific term for completing the assistant's turn in this manner.

  • ✗

    System Role Prompting; it defines the model's persona as a JSON generator.

    Why it's wrong here

    System Role Prompting would involve a 'system' field at the top level of the API call. The exhibit shows a message in the 'assistant' role within the 'messages' array, which is a different mechanism used to guide the immediate output rather than the overall persona.

  • ✓

    Response Prefilling; it eliminates conversational filler and ensures correct formatting.

    Why this is correct

    Response prefilling involves putting text in the 'assistant' role at the end of the message history. Claude treats this as its own previous words and continues from there. It is highly effective for removing 'Sure!' or other filler and starting directly with the data.

  • ✗

    XML Delimitation; it uses the curly braces as tags to separate the data.

    Why it's wrong here

    XML delimitation refers to using <tags> like <name> to structure the prompt. While the exhibit uses JSON (which uses curly braces), this is a data format, not a delimitation technique. The core strategy being used here is the placement of that JSON fragment in the assistant role.

About these practice questions

This CCAO-F question is part of Courseiva's 259-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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 CCAO-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 CCAO-F exam.