Original practice scenario inspired by Industria de Diseño Textil, S.A.'s public business context; this is not a reported interview question or a description of its internal systems. A fictional fashion retailer wants purchase-month cohort revenue net of later returns. Orders, items, and return events are separate tables; one item can have partial returns. Explain the query grain and the difference between an as-of view and a mature view.
Read model answer +
Assign the cohort from the original purchase, then subtract eligible returns linked to its items. Return processing month is a different reporting dimension and should not silently redefine the purchase cohort.
Work through it
Aggregate purchased and returned quantities or signed amounts at item grain, using stable item identifiers. Deduplicate event replays without removing legitimate partial returns.
Apply an explicit observation cutoff to return events for an as-of report. Join item-level totals back to the original order month before aggregating cohort revenue.
Report cohort age and outstanding return windows. Test multiple partial returns, a later-month return, and a return event received after the report cutoff.
Tradeoffs to discuss
Mature cohorts are more comparable but arrive later. A current as-of view is useful if its incompleteness and revision behavior remain visible.
Common pitfalls
Joining raw purchases to raw returns can multiply amounts.
Comparing immature recent cohorts with fully returned older cohorts introduces systematic bias.
Original practice scenario inspired by Industria de Diseño Textil, S.A.'s public business context; this is not a reported interview question or a description of its internal systems. A synthetic online fashion experiment changes product recommendations. Conversion rises, but recommended products sell out faster and control shoppers share the same inventory. How would you analyze the experiment?
Read model answer +
Shared inventory creates interference: treatment can change which products remain available to control shoppers. The usual independent-user comparison may therefore estimate a distorted effect under the tested allocation.
Work through it
Check assignment and exposure, then measure availability trajectories, substitution, cancellations, and net revenue alongside conversion. Keep analysis aligned with the randomized unit.
Investigate whether treatment demand depleted inventory that control would otherwise buy. Use category or location clusters, switchbacks, or separated stock pools only when operationally credible.
Report the experiment's allocation and stock conditions, and assess whether a full rollout would reproduce them. Follow returns long enough to observe downstream effects.
Tradeoffs to discuss
Cluster designs reduce interference but often reduce statistical power. Switchbacks require attention to carryover and replenishment cycles.
Common pitfalls
Conditioning only on products that remained in stock selects on a treatment-affected variable.
A user-level significance test cannot repair interference by itself.