Redfin interview question

How would you program a randomizer?