Amazon interview question

How to handle the data? Any experience on this.