Google interview question

What time complexity has this algorithm and how to calculate it?