Uber interview question

2 coding exercises for each round.