KatInterview

Measuring Impact of a Spam Filter on Friend Request Acceptance

Statistics & ExperimentsModel answer
HardModel answerStatistics & Experimentsexperimentationcausal-inferencea-b-testing

Last updated

Design an A/B test to measure how a tighter spam filter affects 24-hour friend-request acceptance, including randomization, metrics, power, and missing labels.

You're rolling out a tighter spam filter for friend requests and need to measure its effect on user engagement, specifically whether it improves legitimate acceptance rates within the first 24 hours.

Design a complete experiment to answer this question. Your design should address:

a) Hypothesis formulation
Define your primary hypothesis clearly (focus on 24-hour acceptance). Propose at least two guardrail metrics to ensure you're not degrading the product. State null and alternative hypotheses with precision.

b) Randomization strategy
Choose an experimental unit and assignment scheme. Friend requests involve two users—sender and receiver—so network interference is a real concern. Explain your randomization approach, justify it, and discuss residual spillover risks.

c) Metric definitions
Specify how you'll measure 24-hour acceptance. Be precise: define time windows, timestamp boundaries, and how you'll handle requests accepted after midnight or several days later.

d) Sample size and testing plan
Estimate required sample size. State your baseline assumption, minimum detectable effect, and how you'll account for clustering or correlation. Outline test duration and any plan for interim analysis with proper error control.

e) Incomplete spam labels
Not all requests have ground-truth spam labels—some are unclassified. Explain how missing labels could bias your metrics and propose two concrete strategies to address this bias. Describe how you'd present results given these adjustments.

Hints

Hint 1

A stricter filter changes who sends requests, not just who receives them—think about denominator effects on acceptance rates.

Hint 2

Randomizing by sender or receiver alone creates interference; consider clustering the social graph to contain spillover.

Hint 3

Define 'same-day' carefully: calendar day depends on time zone, but a rolling 24-hour window from send time is universal and fair.