Stripe Machine Learning Engineer Onsite Coding Questions
4+ questions from real Stripe Machine Learning Engineer Onsite Coding rounds, reported by candidates who interviewed there.
What does the Stripe Onsite Coding round test?
The Stripe onsite coding round is the core technical evaluation. Machine Learning Engineer candidates typically see 2-3 algorithm and data structure problems. Problems range from medium to hard difficulty, and interviewers evaluate both correctness and code quality.
Top Topics in This Round
Stripe Machine Learning Engineer Onsite Coding Questions
## Problem You are given a machine learning training script with several embedded bugs. Your task is to identify and fix them. **Bug hunt — find at least 4 issues in this pseudocode:** ```python def train(model, X_train, y_train, X_test, y_test): # Bug 1: Normalization uses test stats mean = X_test.mean(axis=0) std = X_test.std(axis=0) X_train = (X_train - mean) / std X_test = (X_test - mean) / std # Bug 2: Shuffle happens after train/test split (data already split above) shuffle_in_place(X_train, y_train) # should be before split for epoch in range(100): loss = model.forward(X_train, y_train) # Bug 3: Gradient not zeroed before backward model.backward(loss) model.step(lr=0.01) # Bug 4: Evaluating on training data, not test data acc = model.evaluate(X_train, y_train) print(f"Epoch {epoch}: acc={acc}") return model ``` ## Follow-ups 1. Why does normalizing using test statistics cause data leakage? 2. What is the effect of not zeroing gradients — in which framework (PyTorch/TF) does this matter most? 3. How would you structure a training loop to prevent these classes of bugs systematically? 4. What automated checks (e.g., assertions, dataset auditing) would you add before training starts?
## Round 1 - System Design ## Problem You have trained a recommendation model (collaborative filtering, ~500ms inference time). Design the integration layer that serves this model as part of a production API handling 10,000 requests per second. **Constraints:** - p99 latency target: 200ms end-to-end. - Model is updated daily with a full retrain. - Fallback required if the model is unavailable. ## Key Design Decisions **Serving Infrastructure** - Model server options: TorchServe, Triton, custom FastAPI. Trade-offs? - How do you handle the 500ms inference time given a 200ms latency budget? **Caching** - Pre-compute recommendations for top 10% most active users. - Cache invalidation on model update. - Cache key design: user_id + context hash (device, time-of-day bucket). **Fallback Strategy** - Popularity-based fallback when model is unreachable. - Circuit breaker pattern to avoid cascading failures. **Model Rollout** - Shadow mode: new model runs alongside old, compare outputs before full cutover. - Canary: route 5% of traffic to new model, monitor click-through rate before promoting. ## Follow-ups 1. How do you detect model degradation in production without labeled ground truth in real time? 2. What monitoring signals alert you to a model update causing a regression? 3. How would you A/B test two models while controlling for novelty effects?
ML System Design: Design an End-to-End Machine Learning Platform for a Streaming Service
## Round 1 - System Design ## Problem Design a machine learning platform for a streaming service that trains, evaluates, deploys, and monitors recommendation models at scale. The platform must support multiple teams running concurrent experiments. **Scope to address:** - Feature store design and online/offline serving. - Training pipeline orchestration. - Model registry and versioning. - Online serving with SLA guarantees. - Experiment tracking and A/B testing framework. - Monitoring for data drift, model drift, and pipeline failures. ## Key Components **Feature Store** - Offline: Hive/Spark for batch feature computation. - Online: Redis for low-latency feature retrieval at inference time. - Point-in-time correct joins to prevent future leakage in training. **Training Pipeline** - Orchestrated via Airflow or Kubeflow Pipelines. - Triggered on new data arrival or schedule; artifact versioning via MLflow. **Serving Layer** - Model registry with staging / production / shadow slots. - Canary deployments with automatic rollback on metric degradation. **Monitoring** - Feature distribution shift (KL divergence alerts). - Prediction distribution shift. - Business metric tracking (CTR, watch time) correlated to model versions. ## Follow-ups 1. How do you ensure training-serving skew is minimized in the feature pipeline? 2. What is your strategy for handling cold-start users in the recommendation model? 3. How do you enforce data governance (PII scrubbing) before features reach the training pipeline?
Card Range Obfuscation Part 2 (ML Eng :)
### Problem Overview - Update non-overlapping card number ranges so any gap between adjacent intervals is filled by extending the lower-end interval. - Input: ordered, non-overlapping intervals that m
What to Expect in the Stripe Onsite Coding Round
The Stripe Machine Learning Engineer Onsite Coding round has a specific calibration purpose distinct from other rounds in the loop. Across 4+ verified reports on LeakCode for this exact round type, the consistent expectations: clear scoping of the problem before diving into a solution, explicit reasoning about complexity, structured handling of edge cases, and the ability to discuss trade-offs between two reasonable approaches.
Reports tagged with the Onsite Coding round at Stripe show recurring patterns in difficulty and topic distribution. The Onsite Coding round is typically 45-60 minutes; the interviewer is calibrated against a specific rubric. The discriminator between candidates who advance and candidates who do not is rarely the final correctness of the answer. It is the path: did you clarify, did you verbalize your approach, did you handle edge cases, and did you communicate throughout.
How To Prepare for This Specific Round
Filter the questions below to the most recent reports (past 6-12 months). Questions tagged for this exact round type from this exact company at this exact role level are the highest-signal data available. Older reports may reference questions that have since rotated out of the company's pool.
Practice 4-6 representative problems from this set under timed conditions. The goal is not memorization (companies rotate questions); the goal is to internalize the patterns the interviewer typically reaches for and the depth of follow-up to expect. Reports on LeakCode also tag the typical follow-up depth at this round type, which is the discriminating signal between hire and no-hire calibration.
Onsite Coding Round Timing and Format
The Onsite Coding round at Stripe typically runs 45-60 minutes. Use the first 2-3 minutes to clarify requirements; you should never start coding or designing without verifying the input/output format, constraints, and edge cases out loud. Use the next 5-7 minutes to verbalize your approach before writing any code. The middle 20-30 minutes are implementation. Reserve the final 10 minutes for testing with concrete examples and discussing optimization or trade-offs.
Time budget discipline is one of the most reliable senior-vs-junior discriminators in this round. Strong candidates verbalize where they are in their budget out loud ("I've used about 20 minutes, I have 15 minutes left for testing and one optimization"). This signals engineering maturity to the interviewer and creates positive feedback they can capture in writing.
Common Failure Modes in This Round
Reports tagged "no hire" at Stripe Machine Learning Engineer Onsite Coding commonly cite: coding silently without verbalizing approach, jumping to implementation before clarifying requirements, missing edge cases (empty input, single element, very large input), producing working code that the candidate cannot refactor when asked, and failing to test their solution with concrete examples before declaring done.
The single most predictive failure mode in 2025-2026 reports: not asking clarifying questions. Interviewers at all FAANG companies are explicitly trained to weight this dimension. Strong candidates ask 3-5 clarifying questions even on problems that look obvious; weak candidates dive into code immediately. The clarifying-question check is often the first signal recorded in the interviewer's notes.
See All 4 Questions from This Round
Full question text, answer context, and frequency data for subscribers.
Get Access