← Boston Consulting Group Interview Insights

Boston Consulting Group·Data Scientist·Online Assessment (OA)·Intermediate

Intermediate
May 2026

Summary

BCG data scientist online assessment, two probability questions under proctoring. Not a vibe-check round, they want you to actually derive things from scratch with no formula sheet to lean on.

Questions Asked (2)

Q1

Given n i.i.d. Bernoulli(p) random variables, derive a closed-form expression for the probability that their sum is even.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I knew parity arguments were a thing but blanked on how to set them up cleanly under time pressure.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Recognize that the sum of n i.i.d. Bernoulli(p) variables follows a Binomial(n, p) distribution. Then, use the probability generating function (PGF) or the binomial theorem to derive a closed-form expression for the probability that the sum is even, which involves evaluating the PGF at 1 and -1.

Pro tip: Mention that the same technique generalizes to finding the probability that the sum is divisible by k using roots of unity, which is a powerful trick in probabilistic combinatorics and can impress interviewers.

1. Identify the distribution

State that the sum S = X1 + ... + Xn follows a Binomial(n, p) distribution, since each Xi is independent Bernoulli(p).

2. Use probability generating function (PGF)

Write the PGF of S as G(z) = (1 - p + p z)^n. The probability that S is even is (G(1) + G(-1))/2.

3. Evaluate G(1) and G(-1)

Compute G(1) = 1 and G(-1) = (1 - 2p)^n. Then the probability is (1 + (1 - 2p)^n)/2.

4. Verify with small cases

Check n=1: probability even = 1-p, formula gives (1 + 1 - 2p)/2 = 1-p, correct. Check p=1/2: probability even = 1/2 for any n, formula gives (1 + 0)/2 = 1/2, correct.

5. Present the closed-form expression

State the final answer: P(S even) = (1 + (1 - 2p)^n)/2.

Key Points to Mention

  • Sum of independent Bernoulli variables is Binomial(n, p).
  • Probability generating function (PGF) or characteristic function approach.
  • Using the identity: P(even) = (1 + E[(-1)^S])/2.
  • Closed-form expression: (1 + (1 - 2p)^n)/2.
  • Special cases: p=1/2 gives 1/2; p=0 or 1 gives 1 if n even, 0 if n odd.
  • Generalization to divisibility by k using roots of unity.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

A fair coin is flipped repeatedly until two consecutive flips show the same outcome. What is the expected number of flips required?

Algorithms & Data Structures
Author's notes

Set up a Markov chain with states tracking the last flip outcome, which felt right.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the process as a Markov chain with states representing the last flip outcome (H or T) and solve for the expected number of flips from the start until absorption. Alternatively, use conditional expectation by defining E as the expected flips from the start and E_s as the expected additional flips given the last flip, then solve the resulting linear equations.

Pro tip: After solving, verify your answer by simulation or by considering the first two flips: if they match, you stop at 2 flips; if not, you are in a symmetric state and the expected additional flips is the same as from the start, leading to a quick equation.

1. Define states and variables

Identify the states: start (no previous flip), last flip H, last flip T. Let E be the expected flips from start, and E_H, E_T be the expected additional flips given the last flip was H or T respectively.

2. Set up equations

Write equations based on the next flip: E = 1 + 0.5 E_H + 0.5 E_T; E_H = 1 + 0.5*0 + 0.5 E_T; E_T = 1 + 0.5 E_H + 0.5*0. Note symmetry: E_H = E_T.

3. Solve the equations

Using symmetry, let E_H = E_T = x. Then x = 1 + 0.5 x => x = 2. Then E = 1 + 0.5*2 + 0.5*2 = 3.

4. Verify and interpret

Check that the answer makes sense: the expected number of flips is 3. Optionally, verify by simulation or by considering the first two flips: if they match (prob 0.5), stop at 2; if not (prob 0.5), you are back to start, so E = 2*0.5 + (2+E)*0.5 => E = 3.

Key Points to Mention

  • Markov chain states: start, last flip H, last flip T
  • Symmetry between H and T states
  • Conditional expectation and linear equations
  • Absorption condition: two consecutive same outcomes
  • Verification by simulation or alternative reasoning
  • Expected value calculation yields 3 flips

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.