Back to problems

Priority Job Scheduler with Invocation-Based Cooldown

Algorithm · Amazon · Hard

Scheduler with Delays Medium · Topics · Company Tags · Hints Design a task scheduler that supports two operations: addJob(taskId, priority, cooldown=0) getJob() Each task has a string taskId and an integer priority. The scheduler must return the task with the highest priority that is currently eligible. When multiple tasks share the same priority, they should be selected in FIFO order (the one that was added or re‑added earliest comes first). After a task leaves getJob(), it…

Checking your access…