Infosys Interview Question

Situation scenario