Pregunta de entrevista de Amazon

linked list, stacks, debugging & Expected Output