A hard Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- hard
- Seniority
- L6
Problem
Given a task dict mapping task names to {'deps': [dep_names], 'func': lambda_source_string}, topologically order the tasks. For each task, evaluate its lambda by passing a dict {dep_name: result_of_dep} as 'inputs'. Return a dict of task_name -> result. Raise an exception if a cycle exists.
Summary
Wire up a mini pipeline and watch it 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.