Jane Street interview question

Asked to implement 2 methods for a game.