Infosys interview question

Scenario based case