Amazon interview question

Write a function to calculate exponents with recursion.