Next Pathway interview question

Pyspark window function scenario question