Amazon interview question

Two questions in Data Structures and algorithms