Amazon interview question

What is the Big O for this algorithm