Amazon interview question

The design problem