ZS Associates Interview Question

The question in Sql was about window functions