Google interview question

Scaling problem