Sample question 1 — Prompt Engineering & Structured Output
A developer is building a structured output pipeline that extracts information from scientific papers. They need Claude to indicate when it's uncertain about an extraction. Their schema has required fields for title, authors, and abstract. How should they handle fields where Claude is uncertain?
- A. C. Use a nullable type with a structured pattern: {value
- B. D. Let Claude add uncertainty notes in the explanation field.
- C. A. Make all fields optional so Claude can omit uncertain ones.
- D. B. Add a confidence score field alongside each extraction field.
Answer: A. The structured outputs documentation recommends using nullable types with explicit confidence indicators for uncertain extractions. This pattern preserves the schema structure while allowing Claude to express uncertainty clearly. Each field includes the extracted value (or null), a confidence level, and reasoning for the assessment. Option C loses required field guarantees. Option D doesn't indicate what the value would be when uncertain. Option B lacks structure.
