Bloomberg interview question

How to implement a function in O(1) time