OpenBet Interview Question

Explain how you would tackle this algorithm