American Express Interview Question

write a sql code on window function guesstimate resume