Snapmint interview question

Window functions question based on rank and lead