FastPrepExtra Coin Win Probability
Problems/Extra Coin Win Probability

Extra Coin Win Probability

Microsoft logoMicrosoft● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A Microsoft Bing Applied Scientist internship phone screen asks for the chance that n+1 coins give more heads than n coins. We chose fair, independent coins, the range of integers, the function signature and a tolerance.

Player A flips n + 1 independent fair coins, and player B flips n independent fair coins. Return the probability that A obtains strictly more heads than B.

Function

extraCoinWinProbability(n: int) → double

Examples

Example 1

n = 1return = 0.5

A's two coins beat B's one coin with probability one half.

Example 2

n = 100return = 0.5

The symmetry argument is independent of n.

Constraints

  • 0 <= n <= 10^9
  • Results use absolute tolerance 1e-12

More Microsoft Phone Screen questions

  • Config Store with Priority OverridesPHONE SCREEN · Seen Nov 2026
  • Corporation Reporting LinesPHONE SCREEN · Seen Oct 2026
  • Random Forest Classifier from ScratchPHONE SCREEN · Seen Oct 2026
  • Least Recently Used CacheOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Greedy and Beam Sentence DecodingPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Top K Frequent ElementsPHONE SCREEN · Seen Sep 2026
  • 3SumPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Arithmetic Expression EvaluatorPHONE SCREEN · Seen Sep 2026
  • Employee Hierarchy Cycle and Depth AnalysisPHONE SCREEN · Seen Sep 2026
  • Most Visited String SectorsPHONE SCREEN · Seen Sep 2026

Similar questions at other companies

  • Biased Coin: Probability of Exactly h HeadsAkuna Capital · PHONE SCREENAkuna Capital interview questions
  • Revolver: Will the Next Shot Fire?Tower Research Capital · PHONE SCREEN
  • Probability of Consecutive HeadsSquarepoint Capital · PHONE SCREENSquarepoint Capital interview questions
  • Expected Fake-Name CollisionsMercor · PHONE SCREENMercor interview questions
  • Painted Cube: Count and RollJane Street · PHONE SCREENJane Street interview questions
  • One Number Is the Average of the Other TwoSusquehanna International Group (SIG) · PHONE SCREENSusquehanna International Group (SIG) interview questions
  • Count Routes Through a City GridIMC Trading · PHONE SCREENIMC Trading interview questions
  • Mean vs Median: Chance of Missing the CenterHudson River Trading · PHONE SCREENHudson River Trading interview questions
  • Count Clean Attendance LogsRippling · PHONE SCREENRippling interview questions
  • Count Array DerangementsInMobi · PHONE SCREENInMobi interview questions

Interview reports that mention this question

  • Microsoft AI/ML Intern Interviews: 114 Experiences (Part 1 of 2)

Microsoft interview experiences

  • Microsoft OA Questions, October 2026: 4 Experiences
  • Microsoft Experienced SWE Phone Screen: 1 Experience
  • Microsoft Explore and Student SWE: 12 Experiences (Part 6 of 6)
  • Microsoft SWE Intern, Early 2025: 41 Experiences (Part 5 of 6)
  • Microsoft SWE Intern, Mid 2025: 42 Experiences (Part 4 of 6)
All Microsoft interview questionsSee Microsoft hiring insights
Saved
class Solution {
    public double extraCoinWinProbability(int n) {
      // Write your code here.
    }

}
Checking account…