Uber interview question

Big O notation