Infosys Interview Question

not sure, its been long time!