Infosys interview question

It was fairly simple.