Meta interview question

Two SQL question about correlation using CTEs and group by functions