Amazon Lottery Question

Design a Lottery System with the following functions. I probably failed this interview, but I can manage to get all of these in O(1) time except the drawWinner.

Having the name as the key is what my issue is, if the identifier were a number, this would be easy, anyone have any ideas?

def registerContestant( name: str ):
    pass

def unregisterContestant( name: str ):
    pass

def isRegistered( name: str ):
    pass

def changeName( oldName : str, newName : str):
    pass

def drawWinner():
    pass
Comments (8)