Amazon interview question

SQL questions using window functions.