← SoFi Interview InsightsSoftware Engineer

SoFi·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

SoFi full-stack screen that was basically one meaty coding problem the whole time. The problem was interesting but I wasn't expecting a probability/simulation angle in what I thought would be a standard backend round.

Questions Asked (1)

Q1

Given a run-tracking system with classes representing individual runs and collections of runs, implement a Monte Carlo simulation (10,000 trials) that estimates the probability an in-progress run will finish at or below the current personal best. Each trial should randomly sample obstacle completion times from historical runs to fill in the remaining obstacles, then compare the projected total against the personal best.

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

My first instinct was to overthink the class design and I wasted probably three minutes asking clarifying questions about the data model before realizing the sampling logic was the actual point.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the data model and simulation requirements, then outline a Monte Carlo algorithm that samples obstacle times from historical runs, computes projected totals, and estimates the probability of beating the personal best. Emphasize efficiency, correctness, and handling of edge cases.

Pro tip: Mention that you would precompute and store historical obstacle times in a data structure for O(1) sampling, and discuss how you would validate the simulation with a small deterministic test case.

1. Understand the problem and data model

Identify the classes for runs and run collections, and clarify how obstacle completion times are stored and accessed. Confirm the definition of 'in-progress run' and 'personal best'.

2. Design the simulation loop

For each of 10,000 trials, randomly sample completion times for remaining obstacles from historical data, sum them with already completed times, and compare to personal best.

3. Implement sampling strategy

Decide whether to sample from all historical runs or only those with similar characteristics (e.g., same obstacle types). Use uniform random selection or weighted by frequency.

4. Compute probability and handle edge cases

Count trials where projected total <= personal best, divide by 10,000. Handle cases with no historical data, zero remaining obstacles, or ties.

5. Optimize and validate

Precompute historical obstacle times into arrays for fast sampling. Validate with a small deterministic example and discuss time complexity.

Key Points to Mention

  • Monte Carlo simulation basics: random sampling, repeated trials, probability estimation
  • Data structures for efficient sampling (e.g., arrays, hash maps keyed by obstacle)
  • Handling of in-progress run state: completed vs remaining obstacles
  • Edge cases: no historical data, zero remaining obstacles, personal best not set
  • Time and space complexity: O(T * R) where T=10,000 and R=remaining obstacles
  • Validation and testing: deterministic small case, statistical convergence

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