The Design Task Manager coding problem asks you to build a system that manages tasks with user IDs, task IDs, and priorities. You need to support adding tasks, editing their priorities, deleting tasks, and most importantly, finding the task with the highest priority. If multiple tasks have the same priority, the one with the largest task ID should be returned.
Bloomberg and Bloomberg frequently ask this to test your ability to maintain a sorted set of data while supporting frequent updates. It evaluations your knowledge of the heap interview pattern or ordered set interview pattern. The challenge is that standard heaps don't support efficient priority updates, so you must find a way to handle "stale" data or use a more flexible structure.
There are two main approaches:
execTop. Use a Hash Map to store the current state of each task. When execTop is called, pop from the heap until you find a task whose priority and existence match the Hash Map.execTop is called ().If the language you use (like C++ or Java) has a set or TreeMap, use it! These structures are essentially balanced BSTs and are often superior to Heaps for design problems because they support removal of any element, not just the top one.
| Title | Difficulty | Topics | LeetCode |
|---|---|---|---|
| Smallest Number in Infinite Set | Medium | Solve | |
| Design a Number Container System | Medium | Solve | |
| Stock Price Fluctuation | Medium | Solve | |
| Exam Room | Medium | Solve | |
| Design Movie Rental System | Hard | Solve |