Courseiva
Using the Claude API →easyMultiple Choice

CCAO-F Using the Claude API Practice Question

A developer needs to stop Claude from generating text as soon as it produces a double newline sequence ('\n\n'). Which API parameter should be used to implement this?

⚠ Common exam trap

Candidates often confuse the 'stop_sequences' parameter with model instructions or system prompts, incorrectly assuming the model will stop on its own if told to do so in the prompt text.

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

✓

stop_sequences

The 'stop_sequences' parameter allows developers to define a list of strings that, if generated by the model, will cause it to immediately cease production of further tokens. This is particularly useful for controlling output format, preventing the model from rambling, or ensuring that the assistant does not simulate a user response in a few-shot prompting 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.

  • ✗

    max_tokens

    Why it's wrong here

    The max_tokens parameter limits the total number of tokens generated based on a hard count, not based on the content of the text. It cannot be used to trigger a stop based on a specific character sequence like a double newline, as it is strictly a numeric limit on output length.

  • ✓

    stop_sequences

    Why this is correct

    The stop_sequences parameter is an array of strings that act as 'cut-off' triggers. When Claude generates any of the specified sequences, it stops exactly at that point. This is the correct tool for ensuring the model stops after a double newline, providing precise control over the completion boundaries.

  • ✗

    system_prompt

    Why it's wrong here

    While you can instruct the model in the system prompt to stop after a double newline, the model may not always follow this instruction perfectly. The stop_sequences parameter is a programmatic guarantee enforced by the API itself, whereas a system prompt instruction is merely a suggestion that the model might ignore.

  • ✗

    top_p

    Why it's wrong here

    Top_p, or nucleus sampling, is a parameter that controls the diversity of the generated text by sampling from a subset of the most likely tokens. It has no mechanism for identifying specific character sequences or terminating the generation process based on the content of the generated strings.

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.