Amazon interview question

Very simple map and tree questions.