Google interview question

Problem about Tree structure (Online Coding)