Amazon interview question

Simple join and rank questions.