Walmart Global Tech interview question

1. Common ancestor in tree 2. find a^b using recursion and further optimization