1mg interview question

sql window functions and some theory