Infosys interview question

Mostly from Agarwal aptitude book.. question patterns not the same question though