This question evaluates understanding of task scheduling and dependency management in directed acyclic graphs, along with algorithmic selection and data-structure-based optimization for repeated minimum-deadline retrieval.
You are building a workflow scheduler.
Each task has:
task_id
deadline
Assume the dependency graph is a DAG.
Implement the scheduler in three stages:
If multiple ready tasks have the same deadline, you may break ties by task_id or return any consistent order.