Meta Interview Question

First round coding problem is about tree and second is about dot product.