American Express Interview Question

basic sql windows function questions, 3 jar + hourglass puzzle