Amazon interview question

Utilize window functions to extract info based on schema.