doValue interview question

1) Rank over partition 2) SQL joins and filtering