FirstCry com interview question

Aggregate functions, temp tables, CTE