Amazon interview question

Technical interval on depth first search