PACCAR interview question

SQL - window functions, Python logical thinking