Man Group interview question

Depth first search on a graph