Barclays interview question

not too hard