Interview Experience 2021

Online Assessment:Given a tree rooted at 1 with n nodes, q queries are given. In each query, d, e are given as input. You need to find the maximum value of e^x where x is one of the ancestors of d or d itself in the tree.n