Infosys Interview Question

It was fairly simple.