J.P. Morgan interview question

How to print reverse integer and string?