FastPrepPassing Cards Around a Circle
Problems/Passing Cards Around a Circle

Passing Cards Around a Circle

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

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A report from December 2024 on a 30-minute HR screen for a SIG quant internship includes a card-passing question. A class of 100 sits in a ring, every student hands a card to one of the two neighbors, and the question asks how many students should end up empty-handed on average. The report does not say how likely each direction is.

Here, the number of people n (2 to 10^9) and the chance of passing left, in whole percent, are inputs, and each person chooses independently. The interview case, 100 people with even odds, is the first example. Answers within 10^-9 (absolute or relative) are accepted.

Our version is about 85% the same as the reported question.

n people sit around a round table, facing the middle, so each person has a neighbor on their left and a neighbor on their right. Everyone holds one card.

At the same moment, every person passes their card to one neighbor. Each person passes to their left neighbor with probability leftPercent / 100 and to their right neighbor otherwise. The choices are independent.

Return the expected number of people who hold no card after the cards are passed.

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

Function

expectedEmptyHanded(n: int, leftPercent: int) → double

Examples

Example 1

n = 100leftPercent = 50return = 25.0

This is the interview case. Look at one person. A card can only come from their two neighbors. They end up with nothing only if the neighbor on their left passes to the left (away from them) and the neighbor on their right passes to the right (also away). That happens with probability 1/2 × 1/2 = 1/4.

The expected count is the sum of every person's chance: 100 × 1/4 = 25.

Example 2

n = 3leftPercent = 50return = 0.75

Each of the 3 people is empty-handed with probability 1/4, as above, so the answer is 3 × 1/4 = 0.75.

Example 3

n = 2leftPercent = 30return = 0.0

With two people, each person's left and right neighbor is the same person, and that person's card comes to them whichever way it is passed. Nobody ends up empty-handed, so the answer is 0.

Constraints

  • 2 <= n <= 10^9
  • 0 <= leftPercent <= 100

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

  • 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
  • Employee Count Median, Mean and ModeClay · PHONE SCREEN
  • Newton Square Root to a Guaranteed ToleranceSquarepoint Capital · PHONE SCREENSquarepoint Capital interview questions
  • Biased Coin: Probability of Exactly h HeadsAkuna Capital · PHONE SCREENAkuna Capital interview questions

Interview reports that mention this question

  • SIG Quant Research Intern Interviews: 60 Experiences

Susquehanna International Group (SIG) interview experiences

  • SIG Quant Researcher Experienced Hire Interviews: 11 Experiences
  • SIG Quant Researcher New Grad Interviews: 49 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 expectedEmptyHanded(int n, int leftPercent) {
        // Write your code here.
    }
}
Checking account…