American Express interview question

basic sql windows function questions, 3 jar + hourglass puzzle