Genpact interview question

was not that difficult.