Amazon interview question

dsa on graphs was asked