D6: Output Handling & Structured Output
Claude Certified Developer – Foundations exam practice questions · 10 flashcards
Question
How do you get reliable structured output?
1 / 10
Tip: Space flips the card, ← / → navigate.
Show all 10 Output Handling & Structured Output practice questions and answers
- How do you get reliable structured output?Use the structured outputs feature or tool use with a JSON schema, plus clear format instructions.
- What is defensive parsing?Parsing output with error handling for malformed or unexpected content instead of assuming it's valid.
- What should you do with JSON output before using it?Parse it, validate it against the expected schema, and handle failures before processing.
- Is 'it parsed successfully' enough?No. Valid JSON can still miss fields or contain wrong types/values.
- Why treat model output as untrusted input?It may be wrong, malformed or influenced by injected content.
- What does 'skepticism toward confident output' mean?Don't trust output because it sounds certain; verify important claims and values.
- What should happen when validation fails?Retry with error feedback, use a fallback, or flag for human review; never pass bad data downstream.
- How can you extract output reliably from text?Ask Claude to wrap it in specific tags and extract between them.
- Why check stop_reason before parsing?max_tokens truncation often leaves incomplete JSON.
- Why not render model output as raw HTML/SQL?It could contain injected code; escape or use parameterized queries.