Google interview question

Basic data structure and recursion question