Electronic Arts Interview Question

Weighted random function.