Downstream
A hard Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- hard
- Seniority
- L6
Problem
You're writing the executor at the core of a small pipeline orchestrator. `tasks` maps each task name to its `deps` (names of tasks that must run first) and `func`, the source text of a lambda that takes a dict of its dependencies' results, keyed by dependency name, and returns this task's output. Run each task once all of its prerequisites have run, return a dict from task name to result, and raise if no valid run order exists because the dependencies form a loop.
Summary
Nothing runs until what it needs has run.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.