Amazon Interview Question

The design problem