Servian interview question

Advanced sql query like partition and rank