Uber interview question

SQL & data structure