Pregunta de entrevista de Accenture

How to reverse a stack and write working code?