CCDV-F Prompt and Context Engineering Practice Question
A developer is building a customer-support bot with the Claude Messages API. The system prompt instructs Claude to answer concisely, but the bot also needs to return a stable JSON object with the fields 'intent', 'sentiment', and 'reply' on every turn. Where should the instruction to produce this JSON object be placed to most reliably control the response format?
⚠ Common exam trap
The trap here is assuming that any instruction in the user message carries the same weight as a system-prompt instruction, when system-level guidance is what persistently controls format across turns.
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
✓
In the system prompt, placed after the conciseness instruction.
The system prompt is the correct place because it is sent with every Messages API request and reliably conditions all assistant turns. Interface requirements such as JSON keys should live there so they are not diluted by user content. Putting format rules in the user turn or in a lone assistant example makes them fragile and easy to override.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
In the system prompt, placed after the conciseness instruction.
Why this is correct
The system prompt is the highest-leverage location for persistent behavioral rules, including output format. Putting the JSON requirement there, after the tone rule, ensures it applies to every turn of the conversation without the caller having to resend it in each user message.
- ✗
Only in the first assistant message as an example.
Why it's wrong here
An assistant example can demonstrate format, but it does not bind subsequent turns. Once the conversation continues, the model is free to drift from that pattern. Format rules belong in the system prompt or in a persistent instruction, not in a single historical assistant turn.
- ✗
Appended to each user message as a trailing reminder.
Why it's wrong here
Repeating the same format instruction in every user turn adds tokens and can be overridden by the user's own text later in the same turn. It also mixes interface rules with user content, which makes the prompt harder to maintain and increases the chance the model treats the reminder as part of the user's request.
- ✗
In a separate follow-up call after Claude replies in prose.
Why it's wrong here
A second call to reformat the prose doubles latency and cost, and it introduces a new chance for information loss during the rewrite. Formatting should be requested in the primary generation, not fixed up afterward, unless the task truly requires a separate validation stage.
About these practice questions
This CCDV-F question is part of Courseiva's 257-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 →
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 CCDV-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 CCDV-F exam.