Recently failed my Google Screening
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2025-03-06Added By Anonymous
Source:Ā Link
š§ Experience: unknown
ā Outcome: Failed
š° Compensation: unknown
š Location: unknown
š¢ Company: Google
š Education: unknown
š Benefits: unknown
š Offer Date: unknown
The question was :
you are given a undirected acyclic graph, each node in the graph can have at most 3 neighbors, find the node in the graph after setting that node a root, the graph will convert in to a binary tree.
I gave a solution but it was O(N^2).
can anyone help me with the solution
ā Outcome: Failed
š° Compensation: unknown
š Location: unknown
š¢ Company: Google
š Education: unknown
š Benefits: unknown
š Offer Date: unknown
The question was :
you are given a undirected acyclic graph, each node in the graph can have at most 3 neighbors, find the node in the graph after setting that node a root, the graph will convert in to a binary tree.
I gave a solution but it was O(N^2).
can anyone help me with the solution