Amazon interview question

Graph based quesitions