Loading…
Google Interview experience
1 round over 2 weeks. No offer, meh experience.
Was asked to solve the following binary tree question
Problem Statement:
Given a binary tree where each node contains either an operator (+, -, *, /) or an integer. The tree represents a mathematical expression where each leaf node is an integer and each internal node is an operator that combines the values of its left and right subtrees. Evaluate the expression represented by the binary tree to return an integer value.
Example:
Input:
*
/ \
+ 5
/ \
3 2
Output: 25
Input:
-
/ \
* 4
/ \
6 3
Output: 14Know 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.