Google Interview Question

How would you approach this question?