Pregunta de entrevista de Incedo

Two puzzles were asked. Stack and Queue basic