American Express interview question

write a sql code on window function guesstimate resume