Google Interview Question

Given above.