FastPrepPoker Suit Expected Profit
Problems/Poker Suit Expected Profit

Poker Suit Expected Profit

IMC Trading logoIMC Trading● EasyNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an IMC Trading new grad phone screen. The report gives an oral puzzle about expected profit and talks about playing once versus many times. The numbers goal is about 90% the same as the report. The deck size and drawing chances were not stated. This exercise assumes 52 ordinary cards and one wildcard joker. The payoff inputs and limits stand in for the reported stakes. Personal risk choices are not part of the task.

A deck has 52 ordinary cards, with 13 cards in each of four suits. One joker is added, so the deck has 53 cards. You pick one suit first. Then one card is drawn, and every card is equally likely.

Your net payoff depends on the card:

  • If the card has your suit, you get winPrize.
  • The joker matches every suit, so drawing it also pays winPrize.
  • Any other card loses lossPenalty, so your net payoff is -lossPenalty.

winPrize and lossPenalty are whole numbers, zero or more. They are already net gains and losses. There is no extra fee to play.

Return the expected net profit of one play as a double. The answer may be negative, so keep its sign. Do not round it to a whole number. Complete pokerSuitExpectedProfit(winPrize, lossPenalty).

An answer is accepted when abs(actual - expected) <= 1e-9 * max(1, abs(expected)).

Overview

A sample game has a gain of 4 and a loss of 1. The same game can also be played with both amounts in the millions. Either way, you compute the expected profit of a single play.

Function

pokerSuitExpectedProfit(winPrize: int, lossPenalty: int) → double

Examples

Example 1

winPrize = 4lossPenalty = 1return = 0.32075471698113206

The winning cards are your suit plus the joker, 14 cards in all. The other 39 cards lose. The expected net profit is (14 * 4 - 39 * 1) / 53 = 17 / 53, about 0.32075471698113206.

Example 2

winPrize = 4000000lossPenalty = 1000000return = 320754.71698113205

Both amounts are the first example's amounts times 10^6. So the expected profit is 17000000 / 53, about 320754.7169811321.

Example 3

winPrize = 1lossPenalty = 1return = -0.4716981132075472

A win and a loss are the same size, but losing cards are more common. The expected profit is (14 - 39) / 53 = -25 / 53, about -0.4716981132075472.

Constraints

  • 0 <= winPrize, lossPenalty <= 10^9.
  • Each of the 53 cards is equally likely to be drawn. You pick the suit before the draw.
  • Return the expected net profit of one play, not rounded. It may be positive, zero, or negative.

More IMC Trading Phone Screen questions

  • Election District Budget Allocation AnalysisPHONE SCREEN · Seen Aug 2026
  • Uniform Variables: Smaller Below Larger SquaredPHONE SCREEN · Seen Mar 2026
  • Combination Sum with Unlimited ReusePHONE SCREEN · Seen Dec 2025
  • Valid Range of a Three-Outcome Probability ParameterPHONE SCREEN · Seen Dec 2025
  • Expected Fishing CatchPHONE SCREEN · Seen Dec 2025
  • Count Routes Through a City GridPHONE SCREEN · Seen Nov 2024
  • Expected City Arrival and Return DaysPHONE SCREEN · Seen Nov 2024
  • Stationary City Population SharesPHONE SCREEN · Seen Nov 2024
  • Maximum Falling Path SumPHONE SCREEN · Seen Nov 2024
  • Trading Profit Percentage ChangePHONE SCREEN · Seen Feb 2024

Similar questions at other companies

  • Parking Fee CalculatorBreeze · PHONE SCREEN
  • Merchant Payout Reserve CalculatorStripe · PHONE SCREENStripe interview questions
  • Sqrt(x)LinkedIn · PHONE SCREENLinkedIn interview questions
  • Automation Pipeline, Part 1: Single WorkerPlaid · PHONE SCREENPlaid interview questions
  • Subtract Two Large Number StringsStackAdapt · PHONE SCREENStackAdapt interview questions
  • Circular Primes Below a LimitAmazon · PHONE SCREEN
  • Palindrome NumberKotak Mahindra Bank · PHONE SCREENKotak Mahindra Bank interview questions
  • Streaming AverageXantium · PHONE SCREEN
  • Fair Coin from a Biased CoinAnthropic · PHONE SCREENAnthropic interview questions
  • Stack Formula InterpreterTypeSafe AI · PHONE SCREEN

IMC Trading interview experiences

  • IMC Trading OA: What It Tests (2026)
  • IMC Trading SWE OA and Video: 18 Experiences (Part 3 of 3)
  • IMC Trading SWE OA Questions: 22 Experiences (Part 2 of 3)
  • IMC SWE New Grad OA and Interviews: 58 Experiences (Part 1 of 3)
All IMC Trading interview questionsSee IMC Trading hiring insights
Saved
class Solution {
    public double pokerSuitExpectedProfit(int winPrize, int lossPenalty) {
        // Write your solution here.
    }
}
Checking account…