Bloomberg Interview Question

How to implement a function in O(1) time