Settle a Parlay With Pushed and Voided Legs
Last updated: November 29, 2026
Quick Overview
Given a stake and a list of parlay legs, each with American odds and a result of win, loss, push or void, compute the payout in cents. Losing any leg loses the parlay, pushed or voided legs drop out, and if every leg drops out the stake is refunded.
Fanatics
November 29, 20260
0
0 solved
Given a stake and a list of parlay legs, each with American odds and a result of win, loss, push or void, compute the payout in cents. Losing any leg loses the parlay, pushed or voided legs drop out, and if every leg drops out the stake is refunded.
Parlays are a big share of handle at Fanatics Sportsbook, and settlement code that is off by a cent across millions of bets becomes a regulatory and customer trust problem. Interviewers look for exact arithmetic, the correct reduction rule for pushes, and a clear rounding policy.
What the Interviewer Expects
- Correct American to decimal conversion for both signs
- Multiply decimal odds of winning legs only
- Short-circuit on any losing leg
- Use exact rational arithmetic and round once
- Refund when all legs are void or pushed
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- Some states require a parlay that reduces to one leg to be settled at that single's odds. Does your code already do that?
- How do you settle when some legs are still pending, for a cash-out quote?
- How would you handle a same-game parlay priced with a correlation-adjusted total rather than a product?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Payout includes the returned stake. Decimal odds: , . Odds strictly between -100 and +100 are invalid. Output in integer cents, floored (the house-favourable conven...
High-Level Design
Walk the legs once. A loss returns 0 immediately. Push or void contributes a factor of 1. A win multiplies the running factor. Use fractions.Fraction because becomes , which is not rep...