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
Coding & Algorithms
Software Engineer
Fanatics
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

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
Odds conversion
Exact arithmetic
Fractions
Settlement rules
Rounding policy
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. 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 Problems
Sample Answer
Requirements

Payout includes the returned stake. Decimal odds: +y→1+y/100+y \to 1 + y/100, −x→1+100/x-x \to 1 + 100/x. 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 −110-110 becomes 21/1121/11, which is not rep...


Submit Your Answer
Markdown supported

Related Questions