Infosys interview question

The questions were simple.