Infosys interview question

Oops concept Situation based question