DoorDash interview question

Do you know how to optimize your algorithm to generate an O(1) time complexity?