By role
SQL interview questions for product analysts
Product analyst screens test how you turn event logs into answers: funnels where steps must happen in order, retention by signup cohort, activation, sessions and A/B test readouts.
What to get right
- Count distinct users, not rows. One user fires many events.
- Funnel steps happen in order. A purchase before a view is not a conversion.
- Pick the cohort date once and carry it through every step.
Funnels Read the lesson
- Ad funnel from impressions to buyers by channelMarketing wants one funnel per channel for the whole period: impressions, clicks, sign-ups and buyers.
- Biggest drop-off step in the ride funnelOperations wants to know where each city loses the most ride requests.
- Conversion between each funnel stepThe shopping app has a four step funnel, in this order.
- Median hours from sign-up to first purchaseGrowth wants to know how long new users take to buy for the first time, by platform.
- Ordered purchase funnel by platformBuild a purchase funnel for each platform where every step has to happen after the step before it.
- Purchase funnel by experiment variantThe team tested a new onboarding flow (new_onboarding in experiment_assignments).
- Purchase funnel inside a single sessionThe product team wants a session-level funnel: how many browsing sessions turn into a purchase without the user leaving the session.
Cohorts and retention Read the lesson
- Week-two retention by acquisition channelMarketing wants to compare how well each acquisition channel keeps its users in their second week.
- Day 1 and day 7 retention by sign-up monthProduct reports classic "day 1" and "day 7" retention for each sign-up month.
- Listeners who came back after a gapThe retention team wants to find listeners who drift away and then return.
- Retention table for months 0 to 3The growth team wants the raw numbers behind a retention triangle, in long format: one row per sign-up cohort and month number.
- Weekly sign-up cohorts and next-week buyersThe marketing team tracks whether new sign-ups come back to buy. Group users into weekly cohorts and measure repeat buying in the following week.
- Month-one retention by sign-up cohortProduct wants month-one retention for each sign-up cohort. A user's cohort is the calendar month they signed up (users.signed_up_at).
Ratios and percentages Read the lesson
- Share of users who purchased, by platformThe product team wants to know what share of users have ever bought something in the app.
- Click-through rate by campaignThe marketing team reports the click-through rate (CTR) of each campaign: all the clicks it received divided by all the impressions it served, over every...
- Driver cancellations among accepted ridesDriver operations wants to know how often a driver backs out after accepting a request.
- Sign-up to purchase conversion by campaignThe growth team judges each campaign by how many of its sign-ups ever bought something.
- Skip rate by genreThe content team wants to know which genres get skipped. A play is a skip when seconds_played is less than 30. A play of exactly 30 seconds is not a skip.
- Share of sessions with a search, by platformProduct wants to know how often a visit to the app includes a search. A session is one distinct session_id, and every session belongs to a single user.
Gaps and islands Read the lesson
- Streaks of four or more days of opening the appThe engagement team wants to find habit-forming users. A user has an app-open day when they fire at least one app_open event on that UTC calendar day.
- Listening sessions split by a 30-minute gapThe product team defines a listening session from play timestamps alone.
- Longest run of consecutive driver cancellationsThe marketplace team wants to find drivers who cancel repeatedly in a row.
Dates and time Read the lesson
- Active users in the 30 days before a dateThe product team reports thirty-day active users per platform, measured as of 2025-06-01.
- Listens by hour of dayThe music team plans playlist drops around when people listen. Look at May 2025 (from 2025-05-01 00:00:00 up to, not including, 2025-06-01 00:00:00).
- Listener tenure in whole months by planThe retention team wants the average tenure of listeners on each plan, as of 2025-06-30. Tenure is the number of whole months between joined_on and 2025-06-30.
- Weekend vs weekday revenue per calendar dayThe shopping app team wants to know whether weekends earn more than weekdays in May 2025.
Deduplication and latest row Read the lesson
- Events fired twice within ten secondsThe app sometimes sends the same event twice when a button is tapped quickly. The analytics team wants to know how many events to drop.
- Keep the first purchase event for each web userGrowth wants one row per user for their first purchase, to build a "first order" table. Use only users whose platform is web.
More for this role
- Plays, listeners and hours by genreGroup and aggregate
- Average order value by channelGroup and aggregate
- Completed trips by driver tenure bandGroup and aggregate
- Customers grouped by how many orders they placedGroup and aggregate
- Resolution speed buckets and satisfactionGroup and aggregate
- Riders whose first and last trips are 71 days apartGroup and aggregate
- Share of June plays by deviceGroup and aggregate
- Most played genre for each plan and deviceGroup and aggregate
- Plays in the first two weeks for April joinersJoins
- Recurring revenue by plan on a given dayJoins
- Sign-ups per campaign who placed a large orderJoins
- Trips from brand-new riders, by cityJoins
- Each December rider's most recent completed tripJoins
- Free and paid listeners per genreJoins
- Listeners who played both jazz and folkJoins
- Purchases after assignment in the one-tap checkout testJoins
- Average first purchase value by campaign, organic includedRanking and top N
- Driver rating leaderboard, unrated drivers lastRanking and top N
- First order value by acquisition channelRanking and top N
- Genre of each listener's first playRanking and top N
- Listener quartiles by May listening timeRanking and top N
- Top two artists each month by listening timeRanking and top N
- Two cheapest campaigns per month by cost per clickRanking and top N
- How far each artist climbed or fell from April to MayRanking and top N
- Repeat contact within 14 days of a first ticketRanking and top N
- Plays that were immediately replayedRunning totals, LAG and LEAD
- June purchases compared with the first purchaseRunning totals, LAG and LEAD
- Record click days with a running maximumRunning totals, LAG and LEAD
- Running count of distinct buyers by first purchase monthRunning totals, LAG and LEAD
- Time until a rider requests again after cancellingRunning totals, LAG and LEAD
- Events in the 10 minutes before each purchaseRunning totals, LAG and LEAD
- Seven-day moving average of sign-upsRunning totals, LAG and LEAD
- Customers whose first order used a couponCTEs and subqueries
- Listeners whose first play was on a speakerCTEs and subqueries
- Riders who came back after a driver cancelledCTEs and subqueries
- Buyers whose latest purchase beat their earlier averageCTEs and subqueries
- Full-play rate by genreConditional aggregation
- Plays per device for each planConditional aggregation
- Rider cancellations per completed trip, by cityConditional aggregation
- Customers who buy in the app but never on the webConditional aggregation
- Listener device habits by planConditional aggregation
- Repeat cart adders who never boughtConditional aggregation
- Requests and completion rate by time of dayConditional aggregation
- Seven-day buyer rate by campaignConditional aggregation
- Customers by referral source, with unknown shownNULL handling
- Average satisfaction score by channelNULL handling
- Riders who got a different driver than last timeNULL handling
- Monthly buyers and growth, with gap monthsPeriod over period
- Artist rank change from May to JunePeriod over period
- Trips between a rider and a driver they already knowSelf joins
- Users whose carts turn into purchases within 30 minutesSelf joins
- Customers with savings but no open checking accountRows with no match
- Listeners who played no jazz in JuneRows with no match
- Sign-ups who never bought, by sign-up monthRows with no match
- New riders with no completed trip in their first 14 daysRows with no match
- 90th percentile trip length by cityMedians and percentiles
- Purchase value spread (interquartile range) by platformMedians and percentiles
- Browse-only sessions by platformText and set operations
- Customers who bought from two categoriesText and set operations