Design an Experiment for a Marketplace Convenience Feature
Statistics & ExperimentsModel answerLast updated
Plan and evaluate a controlled test for a new guest amenity in a two-sided platform, covering unit choice, metrics, power, and interference risks.
You work as a data scientist at a two-sided marketplace platform. The product team wants to test a new convenience amenity that allows guests to drop off their belongings at a secure storage facility near their accommodation before the official check-in window opens. This way, travelers arriving early can explore the area without carrying their bags.
Your job is to design the experiment that will determine whether the platform should roll out this feature broadly.
The question has two components: experimental design (Parts 1–5, 7) and hands-on test execution (Part 6).
Background & Constraints
- The platform is a two-sided marketplace: changes affect guests, hosts, and platform economics. These interests don't always align.
- Storage facilities have limited capacity in each geographic area and may be shared across multiple bookings.
- Relevant outcomes appear across the entire trip lifecycle: some (like booking conversion) occur early, while others (ratings, support issues, damage disputes) only materialize days after checkout.
- Use standard hypothesis testing conventions unless you have strong justification otherwise: $\alpha = 0.05$ (two-sided), 80% power.
- Historical data on baseline metrics (support contact rates, conversion rates, etc.) is available for sample-size calculations.
Clarifying Questions You Should Consider
- Does the feature appear pre-booking (influencing search and conversion) or post-booking (improving the stay experience)? This shifts both the primary metric and the assignment timing.
- Is storage listing-specific (managed by individual hosts) or shared infrastructure (centralized facilities serving a neighborhood)? This determines whether interference between units is plausible.
- What's the rollout plan — a UI toggle, host opt-in, or city-by-city launch? The experiment should match the real deployment mechanism.
- Is the service complimentary or paid? Pricing affects both the metric suite and the revenue equation.
- What minimum detectable effect would make launch worthwhile given implementation costs?
- Are there liability or insurance concerns (lost or damaged items) that could block launch even if metrics look positive?
Part 1: Randomization Unit
What should be the unit of randomization: guest account, reservation, host/listing, or geographic market? Justify your answer and explain how the decision depends on the feature's implementation details.
What to address:
- Go beyond defaults ("always randomize users") and reason from interference and SUTVA.
- Identify contamination channels (shared capacity, host behavior shifts) and which unit choice contains them.
- Discuss the power vs. validity tradeoff: smaller units give more power but may violate independence assumptions.
Part 2: Population and Treatment Definition
Define the eligible population, treatment condition, and control condition with enough precision that an engineer could implement the assignment logic.
What to address:
- Eligibility must be determined before assignment and not depend on post-randomization actions.
- Treatment is the opportunity to use the amenity, not actual usage.
- Control reflects the current realistic alternative, not an artificially degraded experience.
Part 3: Metric Selection
Select a primary metric, a set of secondary metrics, and guardrails. Discuss tradeoffs across guest satisfaction, host satisfaction, operational expenses, safety, and platform revenue.
What to address:
- Justify a single primary metric based on where the feature sits in the user journey.
- Organize metrics hierarchically (primary / secondary / guardrail), not as a flat list of everything measurable.
- Explicitly acknowledge marketplace tensions — name the guardrails protecting hosts, safety, and costs, and state a launch decision framework.
Part 4: Sample Size and Duration
Explain how you'd calculate the required sample size and determine the test duration.
What to address:
- Compute sample size from a pre-specified minimum detectable effect using the appropriate power formula for your primary metric type.
- Account for design effect inflation if randomizing at a clustered level, with intuition about intra-cluster correlation.
- Duration reasoning beyond simple arithmetic: weekly patterns, the lag between assignment and outcome maturation, and thin-traffic markets.
Part 5: Analysis Methodology
Describe how you would estimate the treatment effect and compute statistical significance for the primary metric, including variance reduction and handling of clustered designs.
What to address:
- Explicitly state the intention-to-treat estimand and never condition on post-assignment usage.
- Match the statistical test to the metric type and report confidence intervals and effect sizes, not just p-values.
- Discuss variance reduction techniques (covariate adjustment, CUPED) and cluster-robust inference when relevant.
Part 6: Hands-On Test Execution
You receive a reservation-level experiment dataset with these columns:
| Column | Type | Description |
|---|---|---|
unit_id | string | Randomization unit identifier |
guest_id, host_id, listing_id | string | Participant identifiers |
market | string | Geographic market |
assignment_variant | string | treatment or control |
assigned_at | timestamp | Assignment timestamp (UTC) |
checkin_at, checkout_at | timestamp | Stay dates |
booked | int | 1 if booking completed |
used_locker | int | 1 if guest used the amenity |
support_contacted | int | 1 if guest contacted support |
post_stay_rating | float | Guest rating after checkout |
gross_booking_value | float | Booking revenue |
pre_assignment_trips | int | Historical trip count (pre-period) |
pre_assignment_support_rate | float | Historical support rate (pre-period) |
is_aa_test | bool | TRUE for A/A holdout rows |
Explain concretely how you would:
- Run the A/B test to estimate the effect and compute a p-value using this table
- Run an A/A test to detect bias, sample ratio mismatch, or instrumentation problems
Reference specific columns in your answer.
What to address:
- A column-specific, executable A/B procedure: filtering, validation checks, and ITT estimation on your chosen primary.
- Treat
used_lockeras post-treatment only — a diagnostic, never a filter for the main analysis. - An A/A that includes sample ratio mismatch testing (chi-square) and covariate balance checks (standardized mean differences), with interpretation of failures.
Part 7: Risk Assessment
Identify risks specific to this experiment: selection bias, interference between arms, capacity constraints, host-side spillovers, and heterogeneous treatment effects across markets. For each, explain how your design or analysis addresses it.
What to address:
- A risk-mitigation mapping: pair each risk with the specific design choice or analysis technique that addresses it.
- Show that mitigations are the same levers chosen earlier (unit selection, ITT, stratification), demonstrating design coherence.
- Address heterogeneity discipline — pre-specified subgroup analyses, not post-hoc data mining.
Hints
Hint 1
Consider how shared infrastructure creates dependencies between seemingly independent units
Hint 2
The booking-to-outcome timeline spans weeks; your test duration must account for this maturation lag
Hint 3
Intent-to-treat preserves randomization; conditioning on actual usage introduces post-treatment bias
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Model Answer
A strong response demonstrates end-to-end experimental thinking: connecting the product question to design choices, to statistical methods, to launch decisions. Here's how to approach each part:
Part 1: Randomization Unit
Recommended choice: Reservation-level randomization (with caveats).
Reasoning:
- Guest-level seems natural but creates problems: if a guest books multiple stays during the test, later reservations see spillover from earlier treatment exposure (learning effects, preference shifts). This violates SUTVA.
- Reservation-level aligns with the feature's natural scope — each booking is an independent decision to use storage or not. However, this only holds if storage capacity is not shared across units.
- Host/listing-level makes sense if the feature changes host behavior (e.g., hosts with storage access adjust check-in policies). It also contains capacity interference if storage is host-managed.
- Market-level is the safest when storage is shared infrastructure with capacity constraints, but drastically reduces power (dozens of markets vs. thousands of reservations).
Key insight: If storage is a shared neighborhood facility, reservation-level randomization creates interference — treatment reservations consume capacity that control reservations might have used in a full rollout. This biases the control group upward (they get better access than they would post-launch). In this case, market-level or time-based switchback designs are needed, accepting the power cost.
Decision rule: For a host-managed feature (no shared capacity), use reservation-level. For shared infrastructure, use market-level or acknowledge the interference and interpret results as a lower bound.
Part 2: Population and Treatment Definition
Eligible population:
- Reservations where
checkin_at - assigned_at >= 4 hours(guests arriving early enough to benefit) - Markets where storage infrastructure exists
- Exclude hosts who already offer equivalent amenities (avoids dilution)
Treatment:
- Guests see an option to reserve storage during booking confirmation or in pre-arrival communications
- Access details (location, hours, PIN code) provided regardless of whether they use it
- The offer itself is the treatment, not actual usage
Control:
- Standard experience with no storage offer
- Guests may still solve the problem themselves (asking hosts, using commercial lockers, carrying bags) — this is the realistic baseline
Critical: Assignment happens at a fixed point (e.g., booking confirmation) before any behavioral outcomes. Never re-randomize or exclude based on post-assignment actions.
Part 3: Metric Selection
Primary metric (choose based on feature positioning):
If the feature is visible pre-booking (search/booking funnel):
- Booking conversion rate (searches → bookings)
If the feature is post-booking (fulfillment experience):
- Post-stay guest rating (reflects overall satisfaction with the stay experience)
Secondary metrics:
- Guest: Support contact rate, rebooking rate within 90 days
- Host: Host ratings from guests, cancellation rate
- Platform: Gross booking value, contribution margin per reservation
Guardrails (must not degrade):
- Safety: Damage claim rate, lost-item dispute rate
- Host experience: Host support contacts, host retention
- Cost: Operational cost per booking (storage fees, support overhead)
- Capacity: Storage utilization rate (cap at 80% to maintain availability)
Launch decision rule: Primary metric improves at p < 0.05 AND no guardrail degrades beyond a pre-specified threshold (e.g., support contacts up <5%, damage claims up <2%).
Part 4: Sample Size and Duration
Sample size calculation:
For a binary primary (e.g., booking conversion), use the two-proportion test formula:
$$n = \frac{(z_{\alpha/2} + z_\beta)^2 \cdot (p_1(1-p_1) + p_2(1-p_2))}{(p_1 - p_2)^2}$$
Where:
- $p_1$ = baseline rate (control), e.g., 0.15 booking conversion
- $p_2$ = treatment rate = baseline + MDE (minimum detectable effect)
- $z_{\alpha/2} = 1.96$ (for α=0.05 two-sided), $z_\beta = 0.84$ (for 80% power)
Example: Detecting a 2 percentage point lift (0.15 → 0.17) requires ~4,700 reservations per arm.
If randomizing at market level: Multiply by the design effect: $1 + (m-1)\rho$, where $m$ is average cluster size and $\rho$ is intra-cluster correlation (typically 0.01–0.05 for behavioral metrics). For 20 markets with 500 bookings each and ρ=0.02, design effect ≈ 10, so you need ~94,000 total reservations.
Duration:
- Maturation lag: Post-stay ratings appear 1–3 days after checkout. For 3-night average stays, you need ~2 weeks from assignment to outcome.
- Seasonality: Run for at least one full week (ideally 2–4) to average over day-of-week effects.
- Minimum: 2–3 weeks if post-stay metrics are primary; 1 week if using booking conversion.
Part 5: Analysis Methodology
Estimand: Intention-to-treat (ITT) effect — the average outcome difference between assigned-to-treatment and assigned-to-control groups, regardless of actual usage.
Estimation procedure:
-
Validate assignment integrity:
- Check
unit_iduniqueness (no double assignments) - Verify
assigned_atprecedes all outcome timestamps - Run sample ratio mismatch test (chi-square on arm sizes)
- Check
-
Primary analysis:
- For binary metrics (booked, support_contacted): Two-proportion z-test or logistic regression
- For continuous metrics (post_stay_rating, gross_booking_value): Two-sample t-test or OLS regression
- Report: Point estimate, 95% CI, p-value, and effect size (percentage change or Cohen's d)
-
Variance reduction:
- Use CUPED (Controlled-experiment Using Pre-Experiment Data): Regress outcome on pre-period covariates (
pre_assignment_trips,pre_assignment_support_rate), then test on residuals. This can reduce variance by 10–30%. - Include strata fixed effects (market, booking value tier) if used in assignment.
- Use CUPED (Controlled-experiment Using Pre-Experiment Data): Regress outcome on pre-period covariates (
-
Cluster-robust inference:
- If randomizing at market level, use cluster-robust standard errors (clustered by market) or a permutation test that respects clustering.
Never: Condition on used_locker (post-treatment) for the primary analysis. Usage is an outcome, not a modifier of treatment.
Part 6: Hands-On Execution
A/B Test Procedure:
-- Step 1: Filter to live test data
CREATE TEMP TABLE test_data AS
SELECT *
FROM experiment_table
WHERE is_aa_test = FALSE;
-- Step 2: Validate assignment integrity
-- Check unit uniqueness
SELECT unit_id, COUNT(*) as n
FROM test_data
GROUP BY unit_id
HAVING n > 1; -- should be empty
-- Check temporal ordering
SELECT COUNT(*) as violations
FROM test_data
WHERE assigned_at >= checkin_at; -- should be 0
-- Step 3: Compute primary metric by arm
-- Example: post-stay rating
SELECT
assignment_variant,
COUNT(*) as n,
AVG(post_stay_rating) as mean_rating,
STDDEV(post_stay_rating) as sd_rating
FROM test_data
WHERE post_stay_rating IS NOT NULL
GROUP BY assignment_variant;
-- Step 4: Apply variance reduction (CUPED)
-- Regress outcome on pre-period covariates, test on residuals
-- (use statistical software for regression + t-test)
-- Step 5: Diagnostic - usage rate (NOT for primary inference)
SELECT
assignment_variant,
AVG(used_locker) as usage_rate
FROM test_data
WHERE assignment_variant = 'treatment'
GROUP BY assignment_variant;
-- This tells us uptake, not treatment effect
A/A Test Procedure:
-- Filter to A/A holdout
CREATE TEMP TABLE aa_data AS
SELECT *
FROM experiment_table
WHERE is_aa_test = TRUE;
-- Check 1: Sample Ratio Mismatch (SRM)
SELECT
assignment_variant,
COUNT(*) as n
FROM aa_data
GROUP BY assignment_variant;
-- Chi-square test: observed counts vs. expected 50/50
-- If p < 0.001, assignment is broken
-- Check 2: Covariate balance
SELECT
assignment_variant,
AVG(pre_assignment_trips) as mean_trips,
AVG(pre_assignment_support_rate) as mean_support_rate
FROM aa_data
GROUP BY assignment_variant;
-- Compute standardized mean difference (SMD):
-- SMD = (mean_treatment - mean_control) / pooled_sd
-- Flag if |SMD| > 0.1 (Cohen's rule of thumb)
-- Check 3: Outcome balance (should be no difference)
SELECT
assignment_variant,
AVG(post_stay_rating) as mean_rating
FROM aa_data
WHERE post_stay_rating IS NOT NULL
GROUP BY assignment_variant;
-- Two-sample t-test; p-value should be > 0.05 (no difference)
Interpretation:
- If A/A shows SRM, assignment mechanism is biased → don't trust the live A/B.
- If A/A shows covariate imbalance, stratification failed → use regression adjustment.
- If A/A shows outcome differences, something is confounded or measured incorrectly.
Part 7: Risk Assessment
Risk-Mitigation Mapping:
| Risk | Design Mitigation | Analysis Mitigation |
|---|---|---|
| Selection bias (assignment correlated with unobserved confounders) | Random assignment validated via A/A SRM check | Covariate balance checks; regression adjustment |
| Interference (treatment units affect control units via shared capacity) | Market-level or time-based randomization if capacity is shared | Acknowledge as limitation; interpret as lower bound |
| Locker capacity constraints (treatment demand exceeds supply) | Capacity utilization as a guardrail (<80%); launch only in markets with sufficient infrastructure | Stratify by capacity availability in analysis |
| Host spillovers (hosts change behavior based on neighbor treatment) | Host/listing-level randomization if spillovers are likely | Cluster-robust SEs; test for contamination in bordering control units |
| Heterogeneous effects (feature works in some markets, not others) | Pre-specify subgroup analyses: high-tourism vs. business markets, budget vs. premium listings | Test interaction terms; apply Bonferroni correction for multiple comparisons |
| Novelty effects (short-term boost that fades) | Run for 3–4 weeks to observe decay | Plot metrics over time; look for post-launch convergence |
| Outcome maturation lag (ratings appear days after checkout) | Test duration includes full stay + rating window (~2–3 weeks) | Filter to reservations with checkout_at + 5 days <= analysis_date |
Key principle: The mitigations are not afterthoughts — they're the same design choices justified in earlier parts (unit selection in Part 1, ITT in Part 5, pre-specified subgroups here). A coherent design defends itself.
Summary
A complete answer:
- Chooses the randomization unit based on interference, not convenience
- Defines treatment as the offer, not usage (preserves ITT)
- Selects a single primary metric aligned with the feature's purpose, plus guardrails for marketplace tradeoffs
- Powers the test accounting for design effects and maturation lags
- Estimates ITT with variance reduction, never conditioning on post-treatment variables
- Runs A/A validation before trusting the A/B result
- Maps each risk to a specific mitigation that was already chosen in the design
The design demonstrates that you understand causality (randomization, SUTVA, ITT), marketplace economics (two-sided tradeoffs), and practical constraints (capacity, cost, safety) — not just statistics in isolation.