Samsung Electronics Interview Question

I was asked to split integer into digits