Amazon interview question

Very high level JS questions