Amazon interview question

big o notation of the program written