Sabre interview question

To Explain the code given in Online Test