Amazon interview question

One question from array and another from tree