← Coinbase Interview Insights

Coinbase·Data Scientist·Take-home Assignment·Senior

Senior
May 2026

Summary

Take-home style case for a DS role at Coinbase. The whole thing was a dense end-to-end ML problem on email campaign data, covering EDA through deployment. Pretty serious scope for a single assignment.

Questions Asked (5)

Q1

Given a CSV of email send-level data with features like opened, clicked, and purchased_within_7d, how would you identify and fix data leakage risks before modeling?

Product Analytics & MetricsTechnical Trade-offsData Modeling
Author's notes

This is the part I almost got wrong.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the prediction problem and the point in time when predictions are made, then systematically audit each feature for temporal consistency and target leakage. Propose concrete fixes like time-based splits, feature lagging, and leakage detection tests, and emphasize validation with a holdout set that mimics production.

Pro tip: Always ask when the prediction is made relative to the data collection—if a feature is only known after the outcome, it's leakage. Use a time-based split and simulate production by training on past data and testing on future data.

1. Define the prediction problem and timeline

Clarify the exact prediction point (e.g., at send time) and the target (e.g., purchased_within_7d). Map out when each feature becomes available relative to the prediction point.

2. Audit features for temporal leakage

Check each feature's timestamp: if it's recorded after the prediction point or after the outcome window starts, it's likely leakage. Look for features that directly encode the target (e.g., 'clicked' when predicting 'purchased').

3. Implement leakage detection techniques

Use correlation analysis, feature importance from a quick model, and permutation tests to spot suspiciously predictive features. Compare model performance with and without suspect features.

4. Apply fixes and validate

Remove or lag leaking features, use time-based splits, and ensure the training set only contains data available at prediction time. Validate on a holdout set that respects the temporal order.

5. Monitor and iterate

After deployment, monitor for leakage drift and re-audit features periodically. Set up alerts for unexpected feature importance changes.

Key Points to Mention

  • Temporal consistency: features must be known at prediction time
  • Target leakage: features that directly or indirectly encode the outcome
  • Time-based train/validation/test splits to mimic production
  • Feature lagging or windowing to ensure only past data is used
  • Correlation and feature importance analysis to detect leakage
  • Business context: understanding the email send process and when data is logged

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

Q2

How would you handle class imbalance, missingness, outliers, and high-cardinality categoricals during EDA on this dataset?

Data ModelingProduct Analytics & Metrics
Author's notes

Fairly broad but I appreciated that they bundled it all together rather than asking each separately.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the answer around the business context—crypto trading data at Coinbase—and emphasize that EDA is iterative and tied to modeling goals. Then systematically address each issue (class imbalance, missingness, outliers, high-cardinality categoricals) with specific techniques, explaining how you'd diagnose and handle them while avoiding data leakage. Conclude by discussing how these EDA decisions inform feature engineering and model selection.

Pro tip: Always tie your EDA choices back to the business problem and model requirements—for example, in fraud detection, class imbalance might be handled with cost-sensitive learning rather than resampling, and high-cardinality categoricals might be encoded using target encoding with proper cross-validation to prevent leakage.

1. Understand the Data and Business Context

Begin by exploring the dataset's structure, types, and summary statistics, while clarifying the prediction goal and how each issue impacts the business (e.g., fraud detection, user churn). This guides which EDA techniques are most relevant.

2. Diagnose Each Issue

Quantify class imbalance (e.g., ratio), missingness patterns (MCAR, MAR, MNAR), outliers (via statistical or visual methods), and cardinality of categorical variables. Use appropriate plots and metrics to assess severity.

3. Handle Class Imbalance

Consider resampling (oversampling/undersampling), synthetic data generation (SMOTE), or algorithmic approaches (class weights, cost-sensitive learning). Evaluate impact using appropriate metrics like AUC-PR, F1, or recall.

4. Address Missingness and Outliers

For missingness, choose imputation (mean/median, model-based, or indicator variables) based on mechanism; for outliers, decide whether to remove, cap, transform, or use robust models, considering their potential signal.

5. Manage High-Cardinality Categoricals

Encode using target encoding, frequency encoding, or embeddings, being careful to avoid overfitting and leakage. Group rare categories or use domain knowledge to reduce dimensionality.

Key Points to Mention

  • Class imbalance: use of resampling, SMOTE, class weights, and evaluation metrics like precision-recall AUC.
  • Missingness: understanding mechanisms (MCAR, MAR, MNAR) and appropriate imputation strategies, including adding missing indicators.
  • Outliers: detection via IQR, z-scores, or visualizations; treatment options like capping, transformation, or robust models.
  • High-cardinality categoricals: target encoding, frequency encoding, embeddings, and handling rare categories.
  • Avoiding data leakage: performing EDA and preprocessing within cross-validation folds, especially for target encoding and imputation.
  • Iterative nature: EDA informs modeling and vice versa; revisit steps as needed.

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

Q3

Build a baseline logistic regression and a gradient-boosted tree to predict purchase within 7 days. How would you set up time-based train/validation/test splits and tune hyperparameters?

Data ModelingTechnical Trade-offsA/B Testing & Experimentation
Author's notes

The time-based split was the part I spent most time on.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by emphasizing the importance of time-based splits to prevent data leakage and simulate real-world deployment. Then outline a chronological split (e.g., train on earliest data, validate on middle, test on latest) and describe hyperparameter tuning using time-series cross-validation. Finally, discuss how to handle class imbalance and evaluate models with appropriate metrics like AUC-PR.

Pro tip: Use a rolling-origin or expanding-window cross-validation for hyperparameter tuning to respect temporal order, and always set aside the most recent data as a final holdout to estimate future performance.

1. Define the prediction window and data scope

Clarify the target: purchase within 7 days of a reference point (e.g., user signup or session start). Ensure features are computed only from data available before the prediction time to avoid leakage.

2. Create time-based splits

Split data chronologically: e.g., first 70% for training, next 15% for validation, last 15% for testing. Use the validation set for hyperparameter tuning and the test set for final evaluation.

3. Set up hyperparameter tuning with time-series CV

Within the training set, use expanding-window or rolling-origin cross-validation to tune hyperparameters for both models. This respects temporal order and provides more reliable estimates.

4. Address class imbalance and model-specific considerations

For logistic regression, use class weights or resampling; for GBT, tune scale_pos_weight or use focal loss. Evaluate with AUC-PR, F1, or lift at a fixed threshold, not just accuracy.

5. Compare models and finalize

Select the best hyperparameters based on validation performance, retrain on training+validation, and evaluate once on the held-out test set. Consider business metrics like expected profit or conversion lift.

Key Points to Mention

  • Time-based splits prevent look-ahead bias and mimic production deployment.
  • Use expanding-window cross-validation for hyperparameter tuning to respect temporal dependencies.
  • Handle class imbalance with class weights, resampling, or appropriate evaluation metrics.
  • For GBT, tune learning rate, tree depth, and number of estimators; for logistic regression, tune regularization strength.
  • Evaluate with AUC-PR, F1, or lift at a fixed threshold, and consider business impact.
  • Always keep a final holdout set (most recent data) untouched until the very end.

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

Q4

How would you evaluate model performance across ROC AUC, PR AUC, calibration metrics, and incremental lift, and how would you compute confidence intervals and assess stability across subgroups?

A/B Testing & ExperimentationProduct Analytics & MetricsTechnical Trade-offs
Author's notes

PR AUC matters more here given the imbalance, I made that point early.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the business context and the specific decision the model will inform, then explain how each metric addresses different aspects of performance. Describe a systematic approach to compute confidence intervals and assess stability across subgroups, emphasizing the importance of uncertainty quantification and fairness in high-stakes domains like crypto.

Pro tip: In fintech, calibration and subgroup stability often matter more than raw discrimination metrics because they directly impact risk and user trust. Always tie your evaluation back to the business cost of errors and regulatory considerations.

1. Clarify the objective and constraints

Understand the model's purpose (e.g., fraud detection, user churn) and the costs of false positives/negatives. Identify any regulatory or fairness requirements that influence metric selection.

2. Select and interpret metrics

Explain when to prioritize ROC AUC (balanced classes), PR AUC (imbalanced classes), calibration (probability reliability), and incremental lift (campaign targeting). Discuss their complementary roles.

3. Compute confidence intervals

Use bootstrapping or analytical methods (e.g., DeLong for AUC) to estimate uncertainty. For calibration, consider confidence bands via bootstrapping or Bayesian approaches.

4. Assess stability across subgroups

Define relevant subgroups (e.g., user geography, transaction volume) and compute metrics per subgroup with confidence intervals. Test for significant differences and investigate causes.

5. Synthesize and communicate findings

Summarize trade-offs, highlight risks from unstable subgroups, and recommend actions (e.g., recalibration, feature engineering, or model retraining).

Key Points to Mention

  • ROC AUC measures ranking ability but can be misleading with class imbalance; PR AUC is more informative when positives are rare.
  • Calibration metrics (e.g., Brier score, reliability diagrams) ensure predicted probabilities match observed frequencies, critical for decision-making.
  • Incremental lift quantifies the additional benefit of targeting based on model scores versus random targeting, often used in uplift modeling.
  • Confidence intervals can be computed via bootstrapping (non-parametric) or analytical methods (e.g., DeLong for AUC, Wilson for proportions).
  • Subgroup stability analysis should include intersectional groups and consider sample size limitations; use techniques like cross-validation or bootstrapping within subgroups.
  • In crypto, regulatory scrutiny and user trust make fairness and calibration paramount; document any disparities and mitigation strategies.

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

Q5

How would you choose a decision threshold for deployment given a known email cost and an estimated treatment effect, and what would your monitoring and retraining strategy look like?

Pricing & MonetizationSystem DesignA/B Testing & Experimentation
Author's notes

Expected value framing: score each user, multiply predicted uplift by avg cart value, subtract $0.003, send if positive.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Frame the threshold choice as an expected-value optimization problem: compare the cost of an email to the expected incremental value from the treatment effect, then set the threshold where expected profit is maximized. Discuss how to estimate the treatment effect from an experiment, account for uncertainty, and translate it into a deployment rule. Then outline a monitoring and retraining plan that tracks model performance, data drift, and business metrics, with clear triggers for retraining.

Pro tip: Emphasize that the optimal threshold depends on the business objective and risk tolerance, and that you would validate it with a holdout experiment before full deployment. Also mention that monitoring should include both model health and the causal effect over time, as treatment effects can decay.

1. Define the decision problem and objective

Clarify the goal: maximize expected profit from sending emails, where profit = (treatment effect * value) - cost. Identify the unit of decision (e.g., user) and the available features for targeting.

2. Estimate the treatment effect and its uncertainty

Use experimental data (A/B test) to estimate the incremental effect of the email on the outcome (e.g., conversion). Quantify uncertainty (confidence intervals) and consider heterogeneity across user segments.

3. Compute the optimal threshold

For each user, predict the probability of a positive response or the expected treatment effect. Set the threshold where expected incremental profit equals zero: P(response) * value * effect - cost = 0. Adjust for risk tolerance and business constraints.

4. Validate and deploy

Test the threshold in a holdout experiment to confirm the expected lift and profit. Deploy gradually, monitoring key metrics and guardrails (e.g., unsubscribe rates, customer satisfaction).

5. Monitor and retrain

Continuously track model performance, data drift, and the causal effect over time. Set up automated alerts for degradation. Retrain periodically or when drift is detected, and re-evaluate the threshold with new experiments.

Key Points to Mention

  • Expected value calculation: threshold where expected incremental profit = 0, incorporating cost, value, and treatment effect.
  • Use of experimentation (A/B test) to estimate treatment effect and validate threshold.
  • Handling uncertainty: confidence intervals, Bayesian methods, or conservative thresholds.
  • Segmentation: different thresholds for different user groups if treatment effect varies.
  • Monitoring: track model performance, data drift, and business metrics (e.g., conversion, revenue, unsubscribe rate).
  • Retraining triggers: performance degradation, data drift, or scheduled retraining, with re-validation of threshold.

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