Mozilla Interview Question

Reverse a string and explain complexities