Infosys interview question

Behaviour question