Grab Interview Question

SQL question, with CTE implementation. Joins