Google | Phone screen | L4
Anonymous User
1763

Sharing my phone screen experience here as I went through others posts during my preparation and were helpful to me.

Question 1: Given an n-ary tree where each node has a weight associated with it. The weight denotes the time taken to propagate water to its children. If the water tap is turned on at the root, what is the minimum time by which all the leaves receive water?

(leaf)
 \
  \
  | IN(3)     
  \   (leaf)
   \/ 
	| Internal Node(5)
	|  
	root(8)
	

For this example, answer would be 16

Follow-up: What if a node can have more than one parent? How do you find the minimum time by which all the leaves receive water in that case?

Comments (7)