Google interview question

Window function and group by