Prompting & Structured Output · 3 to 4 hours
Design a versioned output contract and migration
Upgrade a ticket classifier to a versioned contract with multiple IDs, evidence, and review states, keep two v1-only consumers working, and decide from evaluation data whether a candidate prompt should ship.
Hard
System Design
4 h
Premium
Used in interview rounds:
AI System Design (Hard)1
Step 1: The question
Upgrade the ticket classifier from one nullable order ID to multiple IDs with evidence and review states. Two existing consumers accept only v1. Design the contract, migration, validation layers, regression suite, and rollback. Decide whether the candidate in the evaluation table should ship.
Constraints
- Two existing consumers accept only v1 and must keep working until they migrate
- Stored v1 records stay readable, and a v1 null can mean either no ID or several IDs collapsed for review
- The model produces task fields only; contract version, request identity, and outcome metadata come from the application
- A prompt or model change ships only through predeclared gates, including no material regression on mixed-issue tickets
Deliverables
- The v2 contract: result states, envelope, data fields, and the rules that reject contradictory combinations
- A migration and compatibility plan for v1 records and both v1 consumers, in both directions
- Validation layers and trust boundaries, from the provider schema to domain and source checks
- A regression suite by layer, and a ship or no-ship decision on the candidate prompt with the numbers
- Recovery, concurrency, and rollback behavior, including v2 records written before a rollback
Hard questions are part of Premium: the study guide, reference answer, rubric, and exercises unlock with Premium.
