PwC interview question

SQL self joins. Basic pandas.