Pregunta de entrevista de Google

Basic data structure and recursion question