← Intuit Interview Insights

Intuit·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Intuit data scientist interview with a pandas aggregation and pivot question. Pretty practical, no tricks, just needed to know your groupby and pivot_table mechanics under mild time pressure.

Questions Asked (1)

Q1

Given transaction-level data with columns for date, user ID, SKU, price, channel, customer segment, and platform, compute daily distinct user counts and total revenue grouped by date and platform, then reshape the result into a wide format with one row per day and separate columns for each platform's metrics.

Product Analytics & MetricsData Modeling
Author's notes

The groupby part was fine, nunique for users and sum for price, no issue there.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the grain of the data and the exact metrics needed, then outline a two-step process: first aggregate to daily distinct users and total revenue per platform, then pivot to wide format. Emphasize handling missing platforms and ensuring correct distinct counts.

Pro tip: Mention that distinct user counts should be computed before pivoting to avoid double-counting users who appear on multiple platforms, and consider using a full outer join or reindex to include all dates even if a platform has no activity.

1. Clarify requirements and data grain

Confirm that the data is at transaction level and that we need daily distinct users and total revenue per platform. Ask about date range, platform list, and whether to include days with zero activity.

2. Aggregate to daily metrics per platform

Group by date and platform, then compute COUNT(DISTINCT user_id) for users and SUM(price) for revenue. Ensure that the aggregation is done correctly, especially for distinct counts.

3. Pivot to wide format

Use a pivot operation to transform the long-format aggregated data into wide format, with one row per date and separate columns for each platform's user count and revenue.

4. Handle missing data and validate

Fill missing values with zeros for days where a platform had no activity, and validate the output by checking a few sample dates against the raw data.

Key Points to Mention

  • Use COUNT(DISTINCT user_id) for daily distinct user counts, not COUNT(*).
  • Aggregate revenue with SUM(price) after grouping by date and platform.
  • Pivot using conditional aggregation or a pivot function, depending on the SQL dialect.
  • Ensure that dates with no activity for a platform are included with zero counts/revenue.
  • Consider performance implications for large datasets, such as using approximate distinct counts if exact counts are too slow.
  • Validate the wide format by cross-checking totals against the original data.

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