← Akuna Capital Interview Insights

Akuna Capital·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Quant Engineer interview at Akuna Capital with a probability and betting math problem. Pretty focused on whether you can translate a clean formula into working code without tripping on edge cases.

Questions Asked (1)

Q1

Given a probability p (strictly between 0 and 1), compute the stake you need to wager so that a win yields exactly $1000 net profit, using fair decimal odds of 1/p. Return the result rounded to two decimal places, and handle invalid inputs appropriately.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

The math itself isn't bad once you work out that net profit equals stake times (1/p minus 1), so stake ends up being 1000p divided by (1 minus p).

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the problem: we need to find the stake S such that a win yields exactly $1000 net profit, given decimal odds of 1/p. The net profit on a win is S*(1/p - 1), so set S*(1/p - 1) = 1000 and solve for S. Then, discuss rounding to two decimal places and handling invalid inputs like p <= 0 or p >= 1.

Pro tip: Mention that in a real trading system, you'd also consider rounding conventions (e.g., round half up) and potential floating-point precision issues, and that invalid inputs should be rejected with clear errors rather than silently returning a value.

1. Clarify the problem and assumptions

Restate the problem: given p in (0,1), decimal odds are 1/p, and we want a net profit of $1000 on a win. Confirm that 'net profit' means profit excluding the stake, and that the stake is the amount wagered.

2. Derive the formula

Let S be the stake. A win returns S*(1/p) total, so net profit = S*(1/p) - S = S*(1/p - 1). Set this equal to 1000 and solve: S = 1000 / (1/p - 1) = 1000 * p / (1 - p).

3. Handle invalid inputs

Check that p is strictly between 0 and 1. If p <= 0 or p >= 1, the odds are invalid (division by zero or negative odds). Return an error or a sentinel value as appropriate.

4. Compute and round

Calculate S using the formula, then round to two decimal places. Be mindful of floating-point precision; consider using a small epsilon or a decimal library if exact rounding is critical.

5. Test with examples

Verify with sample values: e.g., p=0.5 gives S=1000; p=0.25 gives S≈333.33; p=0.1 gives S≈111.11. Also test edge cases like p very close to 0 or 1.

Key Points to Mention

  • Derivation of the stake formula: S = 1000 * p / (1 - p)
  • Decimal odds definition: odds = 1/p, so net profit per unit stake = 1/p - 1
  • Input validation: p must be in (0,1); reject p <= 0 or p >= 1
  • Rounding to two decimal places and potential floating-point issues
  • Edge cases: p near 0 (stake near 0) and p near 1 (stake very large)
  • Clarify whether 'net profit' includes or excludes the returned stake

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.