Infosys interview question

asked about depth first search