Amazon interview question

Questions on Graph problems.