Google intern interview experience
Summary
I had an intern interview at Google where I was asked to determine if a given parent array forms a valid tree structure.
Full Experience
I had an interview for an intern position at Google. The problem statement given was: Problem statement:
Given an array where each element specifies the parent of a node, determine whether the structure forms a valid tree.
My approach involved building an adjacency list and validating tree properties. I started a DFS from the root, ensuring no cycles and full connectivity.
Interview Questions (1)
Validate Tree Structure from Parent Array
Given an array where each element specifies the parent of a node, determine whether the structure forms a valid tree.