Barclays Interview Question

not too hard