← Upstart Interview Insights

Upstart·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
Jul 2026

Summary

Upstart data scientist interview that pushed into live coding territory. They had me simulate a radioactive decay problem in real time, which was a step up from just deriving the analytical answer on paper.

Questions Asked (1)

Q1

Write runnable code that Monte-Carlo simulates the decay of 100 particles across many trials, then use the simulation results to estimate the survival probability and compare it to the theoretical value.

Algorithms & Data StructuresA/B Testing & Experimentation
Author's notes

Screen sharing while coding under pressure is a different beast from just talking through math.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the decay model (e.g., each particle has a fixed per-trial decay probability). Then implement a Monte Carlo simulation that runs many trials, tracks the number of surviving particles per trial, and computes the empirical survival probability. Finally, compare the simulated survival probability to the theoretical value (e.g., (1-p)^n) and discuss any discrepancies due to sampling variability.

Pro tip: Use vectorized operations (e.g., NumPy) to efficiently simulate many trials, and always set a random seed for reproducibility. Also, report confidence intervals for your estimate to show statistical rigor.

1. Clarify the problem and assumptions

Define the decay process: each particle independently survives each trial with probability p (or decays with probability 1-p). Confirm the number of particles (100) and the number of trials.

2. Implement the simulation

Write code that, for each trial, simulates the survival of each particle (e.g., using Bernoulli trials) and counts how many survive. Repeat for many trials to build a distribution.

3. Estimate survival probability

Compute the empirical survival probability as the total number of surviving particles across all trials divided by the total number of particles simulated (100 * number of trials).

4. Compare with theoretical value

Calculate the theoretical survival probability (e.g., p^100 if all must survive, or the expected fraction surviving). Compare the simulated and theoretical values, and discuss the law of large numbers.

5. Validate and interpret

Check for convergence by increasing the number of trials, and provide a confidence interval for the estimate. Explain any observed differences and the implications for the problem.

Key Points to Mention

  • Independence assumption: each particle decays independently.
  • Law of Large Numbers: as the number of trials increases, the simulated probability converges to the theoretical value.
  • Use of vectorized operations for efficiency (e.g., NumPy's random.binomial or random.rand).
  • Setting a random seed for reproducibility.
  • Computing confidence intervals to quantify uncertainty in the estimate.
  • Theoretical calculation: if each particle has survival probability p, then the probability that all 100 survive is p^100; the expected fraction surviving is p.

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