Company: CARS24
Difficulty: medium
Task Scheduling Optimisation You are building the scheduler for a shared compute cluster. Every submitted task carries a priority level and an estimated runtime, and the scheduler needs to hand out tasks in priority order while keeping the bookkeeping for the current task pool cheap, so it stores the pool in a circular priority deque. Design the data structure and the operations needed to run this scheduler. The Circular Priority Dequeue must always surface the highest-priority task first, and among tasks that share a priority level, whichever one arrived earlier must come out first. Function description Your task is to implement the following operations: enqueue(task, priority, execution_time): Add a new task with the given priority and estimated execution time to the Circular Priority Dequeue. dequeue(): Remove and return the highest priority task from the Circular Priority Dequeue. execute_next_task(): Execute the next highest priority task in the Circular Priority Dequeue. This sho