Amazon interview question

first interview OOP question second interview DFS question