Meta interview question

a variation on a depth first search question