FARFETCH interview question

Query using Window functions in SQL