Barclays interview question

SQL Joins question and DSA question