Barclays Interview Question

questions on self join