Google Interview Question

based on data structures and algo