Microsoft interview question

simple graph algorithm questions