Pergunta de entrevista da empresa Bank Neo Commerce

I was asked to reverse an integer