Fractal interview question

SQL Queries involving Window functions, Group by, CTEs and writing optimized queries.