← Stripe Interview Insights

Stripe·Data Scientist·Technical Phone Screen·Senior

SeniorPrefer not to say
Jul 2026Remote

Summary

Stripe DS interview with a meaty marketing attribution case. Five sub-parts, all SQL-heavy, and they really wanted you to think about metric design before touching any code. Felt more like a take-home squeezed into a live session.

Questions Asked (5)

Q1

Define a primary success metric for the marketing campaign that is attributable, time-bounded, and robust to activity spikes. Include two guardrail metrics and write out the precise formulas.

Product Analytics & MetricsA/B Testing & Experimentation
Author's notes

I went with 14-day post-contact purchase conversion using only first contacts, which felt right.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the campaign's objective and the business context (e.g., Stripe's B2B payments focus). Then propose a primary metric that is clearly attributable to the campaign, measured over a fixed time window, and resistant to short-term activity spikes (e.g., using a 7-day average or a cumulative measure). Finally, define two guardrail metrics with precise formulas to ensure the campaign doesn't harm other key areas.

Pro tip: Choose a primary metric that is a ratio (e.g., conversion rate) rather than an absolute count, as ratios are naturally robust to activity spikes. Also, explicitly state the attribution window (e.g., 14-day click-through) to avoid ambiguity.

1. Clarify campaign objective and context

Ask clarifying questions to understand the campaign's goal (e.g., lead generation, sign-ups, revenue) and the target audience. This ensures the metric aligns with business priorities.

2. Define the primary success metric

Propose a metric that is attributable (e.g., incremental sign-ups from the campaign), time-bounded (e.g., within 30 days of campaign exposure), and robust to spikes (e.g., use a 7-day rolling average or a ratio like conversion rate). Write the precise formula.

3. Select guardrail metrics

Identify two metrics that could be negatively impacted by the campaign (e.g., customer acquisition cost, churn rate). Write their formulas and explain why they are important to monitor.

4. Explain robustness to activity spikes

Describe how the primary metric mitigates the effect of short-term spikes (e.g., by using a smoothed average or a ratio that normalizes for traffic volume).

5. Summarize and validate

Recap the primary and guardrail metrics, and suggest how to validate them (e.g., through A/B testing or holdout groups).

Key Points to Mention

  • Attribution: Use a clear attribution window (e.g., 14-day click, 1-day view) and consider incremental lift via holdout groups.
  • Time-bounded: Define a specific measurement period (e.g., 30 days post-campaign) to avoid indefinite tracking.
  • Robustness: Use ratios (e.g., conversion rate) or smoothed metrics (e.g., 7-day moving average) to reduce spike impact.
  • Guardrail metrics: Include cost-related (e.g., CAC) and quality-related (e.g., churn) metrics to ensure holistic health.
  • Precise formulas: Write formulas with clear numerator and denominator, e.g., Primary = (Number of incremental sign-ups) / (Number of campaign-exposed users).
  • Statistical significance: Mention the need for sufficient sample size and hypothesis testing to confirm metric changes.

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

Q2

Write SQL to compute, for each contact week and country, the 14-day post-contact purchase conversion rate and average revenue per contacted user. Use only the first contact per user and exclude purchases that happened before the contact time.

Product Analytics & MetricsData Modeling
Author's notes

The first-contact filter using ROW_NUMBER was straightforward.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by identifying the first contact per user using a window function, then join to purchases and filter out purchases before contact time. Aggregate purchases within 14 days post-contact to compute conversion rate and average revenue per contacted user, grouped by contact week and country.

Pro tip: Clarify the definition of 'contact week' (e.g., ISO week of first contact) and ensure you handle users with no purchases correctly by using LEFT JOINs and COALESCE. Also, consider time zones if contact and purchase timestamps are in different zones.

1. Identify first contact per user

Use a window function like ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY contact_time) to select the earliest contact for each user.

2. Join contacts with purchases

Left join the first contacts to the purchases table on user_id, ensuring purchases occur after the contact time.

3. Filter purchases within 14 days

Apply a condition that purchase_time is between contact_time and contact_time + INTERVAL '14 days' to only include relevant purchases.

4. Aggregate metrics by contact week and country

Group by the week of contact (e.g., DATE_TRUNC('week', contact_time)) and country, then compute conversion rate as COUNT(DISTINCT user_id with purchase) / COUNT(DISTINCT user_id) and average revenue as SUM(revenue) / COUNT(DISTINCT user_id).

5. Handle edge cases and format output

Use COALESCE to avoid division by zero, and ensure the final output includes contact_week, country, conversion_rate, and avg_revenue_per_user.

Key Points to Mention

  • Use of window functions to get first contact per user
  • Correctly filtering purchases after contact time and within 14 days
  • Handling users with no purchases via LEFT JOIN and COALESCE
  • Defining contact week consistently (e.g., using DATE_TRUNC)
  • Calculating conversion rate as distinct purchasing users over total contacted users
  • Computing average revenue per contacted user, not per purchaser

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

Q3

Write SQL to build a matched baseline: pair each contacted user to one non-contacted user in the same signup week and country, breaking ties by smallest user_id, then compute the 14-day purchase rate for the matched group.

A/B Testing & ExperimentationData Modeling
Author's notes

This was the part I was least prepared for.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Use a window function like ROW_NUMBER() to assign a rank to non-contacted users within each signup_week and country group, ordered by user_id, then join each contacted user to the non-contacted user with rank 1. After matching, compute the 14-day purchase rate for the matched group by checking if a purchase occurred within 14 days of signup, and aggregate the rate.

Pro tip: Clarify the definition of '14-day purchase rate'—whether it's measured from signup date or contact date—and ensure the matching is done without replacement to avoid bias. Also, mention that you'd check for balance in covariates after matching to validate the baseline.

1. Identify contacted and non-contacted users

Filter the user table to separate users who were contacted (e.g., received a marketing email) from those who were not, ensuring you have the necessary signup_week and country fields.

2. Rank non-contacted users within each stratum

Use ROW_NUMBER() OVER (PARTITION BY signup_week, country ORDER BY user_id) to assign a unique rank to each non-contacted user within each signup_week and country combination.

3. Match each contacted user to one non-contacted user

Join the contacted users to the ranked non-contacted users on signup_week and country, selecting only the non-contacted user with rank = 1 for each contacted user.

4. Compute 14-day purchase rate for matched group

For the matched pairs, determine if each user made a purchase within 14 days of signup (or contact), then calculate the purchase rate as the proportion of users who purchased.

Key Points to Mention

  • Use of window functions (ROW_NUMBER) for deterministic tie-breaking by smallest user_id.
  • Partitioning by signup_week and country to ensure exact matching on these dimensions.
  • Definition of the 14-day window: from signup date or contact date, and handling of time zones.
  • Ensuring one-to-one matching without replacement to avoid reusing non-contacted users.
  • Aggregation of purchase rate: COUNT(DISTINCT purchases) / COUNT(users) within the matched group.
  • Potential need to validate match quality by comparing covariate distributions.

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

Q4

On a specific date, contacted-user conversion in the US drops 20% versus the prior 7-day average. Write SQL to break this down by device and product_id, showing count contacted, 14-day conversion, and delta versus the prior period for each slice. Return the top 3 slices by approximate contribution to the drop.

Root Cause AnalysisProduct Analytics & MetricsA/B Testing & Experimentation
Author's notes

This one was genuinely hard.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the metric definition and time windows, then structure the SQL to compute the drop by device and product_id. Use a CTE to calculate the prior 7-day average and the 14-day conversion for each slice, then compute the delta and rank slices by their approximate contribution to the overall drop.

Pro tip: Always validate the metric definition and time zones with stakeholders before writing SQL; a 20% drop might be due to data pipeline issues or seasonality rather than a real product change.

1. Clarify the metric and time windows

Confirm what 'contacted-user conversion' means (e.g., contacted users who converted within 14 days) and the exact date of the drop. Establish the prior 7-day period for comparison.

2. Aggregate data by device and product_id

Write a subquery to calculate the number of contacted users and conversions for each slice on the specific date and the prior 7-day average. Ensure you handle any missing data appropriately.

3. Compute conversion rates and deltas

Calculate the 14-day conversion rate for each slice on the drop date and the prior period. Compute the delta as the difference between the two rates.

4. Estimate contribution to overall drop

For each slice, approximate its contribution to the overall drop by multiplying the delta by the slice's share of contacted users in the prior period. Rank slices by this contribution.

5. Return top 3 slices

Select the top 3 slices by approximate contribution and present the count contacted, 14-day conversion, and delta for each.

Key Points to Mention

  • Metric definition: clarify what 'contacted-user conversion' means and the 14-day window.
  • Time period comparison: use the prior 7-day average as baseline, not just the previous day.
  • Segmentation: break down by device and product_id to identify which slices drive the drop.
  • Contribution calculation: weight each slice's delta by its share of contacted users to approximate impact.
  • SQL structure: use CTEs for readability and to avoid repeating subqueries.
  • Data quality checks: ensure no missing data or outliers that could skew results.

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

Q5

What check would you add to make sure your metrics aren't biased by users who unsubscribed immediately after being contacted?

Product Analytics & MetricsA/B Testing & Experimentation
Author's notes

Short answer question but I overthought it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging the bias: users who unsubscribe immediately after contact are likely reacting negatively to the outreach, and their exclusion from metrics can inflate performance. Propose a check that compares metrics with and without these users, and consider treating unsubscribes as a negative signal rather than missing data. Emphasize that the right approach depends on the metric's purpose—whether it's measuring engagement or overall campaign impact.

Pro tip: Frame unsubscribes as a form of negative feedback that should be incorporated into the metric, not just excluded. Suggest a sensitivity analysis to quantify the bias and recommend a guardrail metric to monitor unsubscribe rates alongside primary metrics.

1. Define the bias and its impact

Explain that users who unsubscribe immediately are likely dissatisfied, and excluding them from metrics like click-through or conversion rates can overstate success. Quantify the potential bias by comparing metrics with and without these users.

2. Identify the right metric treatment

Decide whether to include unsubscribes as a negative outcome (e.g., assign a value of 0 for engagement) or to analyze them separately. Consider the metric's goal: if measuring overall campaign health, unsubscribes should count against it.

3. Implement a sensitivity check

Calculate the primary metric both including and excluding immediate unsubscribers. If the difference is large, the metric is biased; report both versions or adjust the metric definition.

4. Add a guardrail metric

Track unsubscribe rate as a guardrail to ensure that improvements in the primary metric don't come at the cost of user experience. Set thresholds for acceptable unsubscribe rates.

5. Communicate and iterate

Present findings to stakeholders, recommending metric adjustments or further analysis. Continuously monitor for similar biases in other metrics.

Key Points to Mention

  • Survivorship bias: excluding users who unsubscribe creates a biased sample of engaged users.
  • Negative signal: unsubscribes should be treated as a negative outcome, not missing data.
  • Sensitivity analysis: compare metrics with and without immediate unsubscribers to quantify bias.
  • Guardrail metric: monitor unsubscribe rate to ensure overall campaign health.
  • Metric definition: align metric with business goal—engagement vs. overall impact.
  • Stakeholder communication: transparently report bias and recommend adjustments.

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