FastPrepSure Profit from a Stock and a Casino Bet
Problems/Sure Profit from a Stock and a Casino Bet

Sure Profit from a Stock and a Casino Bet

Susquehanna International Group (SIG) logoSusquehanna International Group (SIG)● MediumINTERNFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Two reports from SIG quant phone screens ask the same hedging question: one from February 2017 (experienced hire) and one from March 2019 (internship, first technical phone screen). A stock trades at 100 today and will be at 50 or 200 tomorrow. A casino takes even-money bets of any size on whether it goes up or down, and the question is how to make money. Both authors answer by buying the stock and betting at the casino that it falls. The 2019 author names a bet of $75.

The reports give no input format and do not say whether short selling is allowed. Here, today's price and a list of 2 to 100 possible prices for tomorrow are inputs. You may buy or short up to one share and place one even-money bet on either direction. The answer is the largest profit you can guarantee, or 0 if none. The interview case is the first example. Answers within 10^-9 (absolute or relative) are accepted.

Our version is about 75% the same as the reported questions.

A stock costs today dollars now. Tomorrow its price will be one of the values in tomorrow, and you do not know which. No value in tomorrow equals today, so the price always goes either up or down.

Today you may do both of these:

  • Buy or short-sell up to one share at today's price. Any amount from -1 to 1 share is allowed (negative means short). Holding q shares earns q × (tomorrow's price - today).
  • Place one bet of any size at a casino on whether the price goes up or down. The bet pays even money: if you bet x dollars and are right, you win x; if you are wrong, you lose x.

Your profit is the share result plus the bet result. Return the largest profit you can guarantee, whichever price in tomorrow happens. If no plan guarantees a positive profit, return 0.

Your answer is accepted if its absolute error or its relative error is at most 10^-9.

Function

sureProfit(today: int, tomorrow: int[]) → double

Examples

Example 1

today = 100tomorrow = [50,200]return = 25.0

This is the interview case. Buy one share and bet $75 that the stock goes down.

  • Price 200: the share earns 100, the bet loses 75, total 25.
  • Price 50: the share loses 50, the bet wins 75, total 25.

No plan does better. With one share and a bet of b on down, the two results are 100 - b and -50 + b, and the smaller of two numbers is at most their average, 25. Fewer shares scale this down, and short selling makes the average negative. So the answer is 25.

Example 2

today = 100tomorrow = [90,105]return = 2.5

The middle of 90 and 105 is 97.5, below today's price of 100, so this time the stock is the expensive side. Short one share and bet $7.50 that the stock goes up.

  • Price 105: the short loses 5, the bet wins 7.5, total 2.5.
  • Price 90: the short earns 10, the bet loses 7.5, total 2.5.

Example 3

today = 100tomorrow = [60,90,150,170]return = 5.0

Buy one share and bet $45 on down. The worst up price is 150: 50 - 45 = 5. The worst down price is 60: -40 + 45 = 5. The other prices do better (170 gives 25 and 90 gives 35), so the guaranteed profit is 5. Shorting one share would guarantee at most 100 - (170 + 90) / 2 = -30, and a smaller short only scales that loss down.

Constraints

  • 2 <= today <= 9999
  • 2 <= tomorrow.length <= 100
  • 1 <= tomorrow[i] <= 10^4
  • tomorrow[i] != today, and at least one price in tomorrow is above today and at least one is below it

More Susquehanna International Group (SIG) Phone Screen questions

  • Dice Sum That Is a Multiple of mPHONE SCREEN · Seen Nov 2026
  • Find Median from Data StreamPHONE SCREEN · Seen Nov 2026
  • Painting Arcs to Nearest Neighbors on a CirclePHONE SCREEN · Seen Sep 2026
  • Filter Movies by Inclusive Year RangePHONE SCREEN · Seen Jul 2026
  • Best Single Reroll for Five DicePHONE SCREEN · Seen Feb 2026
  • Catching the Bus to the MoviePHONE SCREEN · Seen Jan 2026
  • Two Dice Summing to a TargetPHONE SCREEN · Seen Jan 2026
  • Median of Uniform Draws in an IntervalPHONE SCREEN · Seen Oct 2025
  • One Number Is the Average of the Other TwoPHONE SCREEN · Seen Jun 2025
  • Which Coin Pattern Shows Up FirstPHONE SCREEN · Seen May 2025

Similar questions at other companies

  • Logistic Regression with Gradient DescentYahoo · PHONE SCREENYahoo interview questions
  • Constant-Time Weighted Pick with an Alias TableEtched · PHONE SCREEN
  • Adaptive Calibration ErrorOpenAI · PHONE SCREENOpenAI interview questions
  • Random Pick with Weight Using Recorded DrawsGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Reachable Transfer PositionsCitadel · PHONE SCREENCitadel interview questions
  • Find All Pythagorean TripletsDell Technologies · PHONE SCREENDell Technologies interview questions
  • Sort a Quadratic-Transformed ArrayLinkedIn · PHONE SCREENLinkedIn interview questions
  • Filter Paginated Medical RecordsNVIDIA · PHONE SCREENNVIDIA interview questions
  • Minimum Operations to Make Every Array Element OneOtter.ai · PHONE SCREENOtter.ai interview questions
  • Evenly Schedule Vehicle InspectionsAmazon · PHONE SCREEN

Interview reports that mention this question

  • SIG Quant Researcher Experienced Hire Interviews: 11 Experiences
  • SIG Quant Research Intern Interviews: 60 Experiences
  • SIG Quant Researcher New Grad Interviews: 49 Experiences

Susquehanna International Group (SIG) interview experiences

  • SIG Quant Researcher Intern Interviews: 1 Experience
  • SIG Quant Second-Round Tech Screen: 1 Experience
All Susquehanna International Group (SIG) interview questionsSee Susquehanna International Group (SIG) hiring insights
Saved
class Solution {
    public double sureProfit(int today, int[] tomorrow) {
        // Write your code here.
    }
}
Checking account…