Amazon interview question

Code question on data structures and the topic is stack.