← Stripe Interview Insights

Stripe·Machine Learning Engineer·Technical Phone Screen·Senior

Senior
May 2026

Summary

ML coding round at Stripe with a regression-focused problem that had a sneaky preprocessing catch. Nothing flashy, but the question had more depth than it looked at first glance.

Questions Asked (1)

Q1

You have a multi-task regression problem where one set of labels is negative and the other is positive, and the ranges are very different. How do you handle training both tasks together effectively?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

The regression framing threw me a bit since I was expecting classification.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging the challenge of differing scales and signs, then propose a multi-task learning architecture with task-specific normalization and loss weighting. Discuss techniques like uncertainty weighting or gradient normalization to balance tasks, and mention evaluation strategies to ensure both tasks improve.

Pro tip: Emphasize that the goal is not just to balance losses but to ensure both tasks benefit from shared representations; consider using techniques like GradNorm or dynamic weight adjustment based on validation performance.

1. Identify the challenges

Recognize that the tasks have different scales (one negative, one positive) and potentially different units, which can cause one task to dominate training. Also note that negative values can complicate normalization and loss functions.

2. Preprocess and normalize

Apply task-specific normalization: for the positive task, use standard scaling; for the negative task, consider shifting to positive or using robust scaling. Alternatively, standardize each task's targets to zero mean and unit variance.

3. Design the model architecture

Use a shared base network with task-specific heads. This allows shared representations while accommodating different output distributions. Consider separate output layers with appropriate activation functions (e.g., linear for regression).

4. Balance the losses

Combine losses with weights. Use static weights tuned via cross-validation, or dynamic methods like uncertainty weighting (Kendall et al.) or GradNorm to automatically balance tasks during training.

5. Evaluate and iterate

Monitor each task's performance on validation sets. Use metrics like per-task loss and correlation of predictions. Adjust weighting or architecture if one task lags. Consider multi-task learning benefits like improved generalization.

Key Points to Mention

  • Task-specific normalization to handle different scales and signs
  • Shared representation with task-specific heads
  • Loss weighting strategies: static, uncertainty weighting, GradNorm
  • Potential use of gradient surgery or PCGrad to resolve conflicting gradients
  • Evaluation metrics per task and overall multi-task performance
  • Handling negative values: shifting, robust scaling, or using appropriate loss functions

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