Barclays interview question

why this program