Amazon interview question

Whiteboard a dependency resolution algorithm.