SGS & Co interview question

ML maths question related to trees.