Infosys interview question

Mostly focused on core concepts