Design a Ticket Resolution Service
Difficulty: MEDIUMCategory: LLDFrequency: 1Asked On 2024-06-30
Problem Statement
Design a Ticket Resolution Service that allows users to raise, track, and resolve support tickets. The system should support ticket assignment, status management, and prioritization to help support teams handle customer issues efficiently.
🔷 Functional Requirements:
1.Create Ticket:
•Users can create a ticket with:
•Title, description
•Priority (LOW, MEDIUM, HIGH, CRITICAL)
•Category (Billing, Technical, General, etc.)
•Optional attachments or tags
2.Assign Ticket:
•Tickets can be assigned to support agents manually or auto-assigned using simple rules (e.g., round-robin or based on category expertise).
3.Update Ticket Status:
•Status values: OPEN, IN_PROGRESS, WAITING_FOR_CUSTOMER, RESOLVED, CLOSED
•Agents or users can update ticket status and add comments.
4.Track Ticket History:
•Maintain an audit trail for every ticket — who changed what and when.
5.List & Filter Tickets:
•Users and agents can view tickets by filters like status, priority, assignee, category, etc.
6.Reopen Ticket:
•Resolved tickets can be reopened by the customer within a configurable window.
🔷 Constraints & Assumptions:
•A ticket is always created by a User and can be assigned to one Support Agent.
•No authentication or database integration is needed — use in-memory structures.
•You can simulate attachments as string URLs or blob references.
•Performance optimization is not the focus — clean OOP structure is.
🔶 Expected Design Focus:
•Design classes like: Ticket, User, Agent, TicketManager, AssignmentStrategy, TicketHistory
•Use Enums for Priority, Status, Category
•Follow OOP and SOLID principles:
•SRP (each class does one thing)
•OCP (easy to extend ticket status, categories, assignment strategies)
•Use interfaces where abstraction is needed (e.g., for assignment strategy)
🔷 Optional Features (Bonus):
•Add SLA management: alert if a ticket is not resolved within deadline.
•Support internal vs external comments
•Add tag-based search
•Implement ticket escalation rules
•Support ticket merging or splitting
✅ Sample Use Case:
1plaintext
2CopyEdit
31. User A creates a ticket: “App crashes on login” (Priority: HIGH, Category: Technical)
42. Ticket is auto-assigned to Agent X.
53. Agent X marks it IN_PROGRESS and comments: “Looking into logs”.
64. Agent X resolves it. User confirms fix.
75. Ticket is marked CLOSED. Full history is retained.