Amazon interview question

System design and coding question