Google Interview experience
1 round over 3 weeks. No offer, meh experience.
I was asked a weighted cyclic directed graph question in a google doc, where each vertex represents an entity/person. The incoming edges represent the amount owed to that entity, while the outgoing edges represent the amount that entity owes to others. I was asked to output an acyclic graph with updated edge weights. The interviewer was kind and helpful but I wasn’t able to come up with the most optimal solution in time.
Input:
Vertices: A, B, C
Edges:
* A → B (A owes B $50)
* B → C (B owes C $80)
* C → A (C owes A $30, hence forming a cycle) Output: an acyclic graph that consolidates the amounts owed
Vertices: A, B, C
Edges:
* A → B (A owes B $20)
* B → C (B owes C $50)Know someone interviewing at Google? Pass it on.
Same company, different candidates.
Share yours while it’s fresh. It takes five minutes, it’s anonymous, and it will help future candidates.