Amazon interview question

The first one being data structures and algorithms (Graph Algorithm), and the last one being an OOP question.