Given an incomplete object-oriented skeleton that simulates an Airflow-like task pipeline where tasks have dependencies, complete it and add the missing APIs.
Asked in the virtual onsite stage. OOD coding round; the remainder of the prompt is hidden behind the points wall.
Implement Task and Pipeline. A task has a unique name and may depend on other tasks. The pipeline must support adding tasks, adding dependencies, and returning a valid execution order. Return None when a dependency is missing or the graph contains a cycle. When multiple tasks are ready, preserve task insertion order.
run_pipeline(task_specs) receives a list of dictionaries with name and dependencies fields. It returns a list of task names or None.
def run_pipeline(task_specs):