Google Interview Question

Basic traversal and data structure problems