Build a Support Ticket Queue with Priorities
60 min · Medium
Need help? Ask a tutor on WhatsApp (opens in a new tab)A help desk must always pick the most urgent ticket next, and when two tickets are equally urgent the one that arrived first should win.
What you will learn
What you will learn
- Serve tickets by priority with heapq and break ties with an arrival counter
- Keep a bounded history of resolved tickets with deque(maxlen=...)
- Design a small class that hides the heap and exposes clear methods
- Reject bad input with a clear exception and handle an empty queue safely
Sign in to continue this lesson
Create an account to read every lesson, practise with the exercises and keep track of your progress.