Visier interview question

Implement pow func in O(log n), implement a cache.