Amazon interview question

Writing queries with window functions.