Nano Dimension interview question

Implement a hierarchal task executer class in python