Google interview question

Some math questions.