DoorDash Interview Question

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