Amazon interview question

Some graphs concepts used in dsa