ICICI Bank interview question

Explain how do solved problem