System design answer
Email and ticket triage for a support team
An AI step with structured output, business rules on top, routing in the help desk, and drafts a person approves.
The question“Design a system that reads incoming support emails, classifies and prioritises them, routes them, and drafts replies.”
1Clarify0-5 min
Ask before you draw. These answers change the design.
- Volume, languages and categories?
- Which emails are sensitive (legal threats, data deletion, VIP accounts)?
- Will replies be sent automatically or by agents?
- Which help desk?
2Requirements and numbers5-8 min
It must
- Classify category and priority; extract key fields
- Route to the right team with a summary
- Draft a reply for an agent to check
And it must be
- Sensitive emails never auto-sent
- Under 30 s from arrival to routing
- Personal data masked in logs
Numbers to say out loud
- Volume
- 12,000 emails a day
- Categories
- 15 categories, 4 priorities
- Unsure share
- About 8% go to a general queue
3High-level design8-12 min
- Incoming email → AI step, structured output (category, priority, fields, summary, unsure?)
- AI step, structured output (category, priority, fields, summary, unsure?) → Business rules (key account, legal words, deletion request)
- Business rules (key account, legal words, deletion request) → rule matches → Senior or privacy queue
- Business rules (key account, legal words, deletion request) → Unsure?
- Unsure? → yes → General queue
- Unsure? → no → Team queue with a draft reply
- Team queue with a draft reply → Agent checks and sends
4Deep dives12-26 min
Rules over the model
The model classifies, but code rules decide anything with legal or privacy weight: words like "legal notice" or "delete my data" force a route regardless of what the model said.
Drafts
Drafts use the knowledge base with citations; agents edit and send. Edit distance between draft and sent reply is tracked as a quality signal.
5Failures26-30 min
| What can go wrong | What stops it |
|---|---|
| Misrouted urgent email | Rules for urgent signals and an "unsure" path to a person |
| Draft promises a refund | Output check for promises; agents always send |
| Classifier drifts as products change | Weekly review of the unsure queue; retrain categories |
6Evals and monitoring30-33 min
- 500 labelled emails: category and priority accuracy, per category
- Share routed to unsure; agent edit distance on drafts
7Trade-offs33-35 min
- Automatic sending saves time but risks harm; start with drafts
- More categories give finer routing but lower accuracy
Follow-ups to expect
- How would you add a new category without breaking others?
- How do you measure that it saves time?