Google Interview Question

Process simulation based on data structure