Snapmint Interview Question

Window functions question based on rank and lead