BlackBuck interview question

Design your data structure with everything in o(1).