Genpact Interview Question

Question on SQL window functions.