PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/J.P. Morgan

Compute expected value of simple gambling games

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's ability to compute expected value and reason about sequential probabilities in simple gambling scenarios, covering competencies in expectation calculation, net payoff/fair entry fee determination for a die roll, and first-success probability for alternating coin tosses.

  • easy
  • J.P. Morgan
  • Software Engineering Fundamentals
  • Data Scientist

Compute expected value of simple gambling games

Company: J.P. Morgan

Role: Data Scientist

Category: Software Engineering Fundamentals

Difficulty: easy

Interview Round: Technical Screen

You are asked two probability/EV questions. ## 1) Dice game expected value / fair entry fee A game works as follows: - You pay an entry fee of \(c\) dollars to play. - You roll a fair six-sided die once. - If the die shows \(k\in\{1,2,3,4,5,6\}\), you receive \(k\) dollars as your payout. **Questions** 1. What is the expected payout (in dollars)? 2. What is the expected net profit (payout minus entry fee)? 3. What is the largest entry fee \(c\) you should be willing to pay if you want the expected net profit to be \(\ge 0\)? ## 2) Alternating coin tosses: first head wins Two players alternate flipping a fair coin. Player A flips first. - The first player to flip **Heads** wins immediately. **Question**: What is the probability that Player A wins?

Quick Answer: This question evaluates a candidate's ability to compute expected value and reason about sequential probabilities in simple gambling scenarios, covering competencies in expectation calculation, net payoff/fair entry fee determination for a die roll, and first-success probability for alternating coin tosses.

Related Interview Questions

  • Review a PR for thread-safe request handling - J.P. Morgan (medium)
  • Review concurrent code quality - J.P. Morgan (medium)
  • Explain C++ virtual dispatch and object lifetime - J.P. Morgan (medium)
J.P. Morgan logo
J.P. Morgan
Jan 22, 2026, 12:00 AM
Data Scientist
Technical Screen
Software Engineering Fundamentals
1
0
Loading...

You are asked two probability/EV questions.

1) Dice game expected value / fair entry fee

A game works as follows:

  • You pay an entry fee of ccc dollars to play.
  • You roll a fair six-sided die once.
  • If the die shows k∈{1,2,3,4,5,6}k\in\{1,2,3,4,5,6\}k∈{1,2,3,4,5,6} , you receive kkk dollars as your payout.

Questions

  1. What is the expected payout (in dollars)?
  2. What is the expected net profit (payout minus entry fee)?
  3. What is the largest entry fee ccc you should be willing to pay if you want the expected net profit to be ≥0\ge 0≥0 ?

2) Alternating coin tosses: first head wins

Two players alternate flipping a fair coin. Player A flips first.

  • The first player to flip Heads wins immediately.

Question: What is the probability that Player A wins?

Solution

Show

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More J.P. Morgan•More Data Scientist•J.P. Morgan Data Scientist•J.P. Morgan Software Engineering Fundamentals•Data Scientist Software Engineering Fundamentals
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.