Kiwi.com interview question

Write complex SQL query using window functions (input table had > 1 million rows)