Practice question · Select all that apply
Select every edge case the lesson says the task manager should be tested against.
Hints
- Three of these are situations where the program must make a decision that the code has to define.
- Ask which options describe a genuine ambiguity in the design rather than a limit of the hardware.
Show the answer
- A. Cancelling a task that is currently running
- B. Two tasks sharing the same deadline
- C. An empty manager with no tasks at all
Why
Emptiness, duplicate deadlines and cancelling something already running are all points where the behaviour is genuinely undefined until you decide it. A large id is just another key to hash, and running out of memory is a hardware limit rather than a behaviour the design can specify.
Practise Integrated Data-Structure Reasoning
The app has 5 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.
More questions on Integrated Data-Structure Reasoning
- The manager holds 1024 tasks. Order these operations from cheapest to most expensive.
- The task manager keeps every task in a hash table, a heap and a list at once. What does that composition buy,…
- Sort each statement about the composed task manager by whether it is a cost or a benefit of the design.
- A task manager keeps tasks in a hash map, a heap and a sorted list. A delete updates two of the three. When…
- If three structures each hold their own copy of which tasks exist, any update must change all three or they…