Google Interview Question

Data structure related