Infosys interview question

Case based