Amazon interview question

Apply power function. Basic algorithms.