Pregunta de entrevista de Amazon

Code question on data structures and the topic is stack.