Measuring and Experimenting on Spam Without a Label Table
Statistics & ExperimentsModel answerLast updated
Design proxy metrics to monitor spam and user experience, diagnose a drop in report rate, and build a valid A/B test when spammers are rare.
Scenario
A product team wants to roll out anti-spam changes to a messaging feature. No classifier or labeled spam table exists yet. Your job is to design the measurement layer from scratch and think through the experiment.
Questions
Part 1 — Proxy metrics With no classifier output available, what behavioral signals would you track to monitor spam volume and to protect normal user experience? Be specific about what you measure, how you normalize it, and why each signal captures what you claim.
Part 2 — Diagnosing a metric drop After an anti-spam launch, the team notices that the report rate has fallen. Walk through the possible explanations. What additional metrics would you pull to tell a real improvement apart from a measurement artifact or an adversarial shift?
Part 3 — Experiment design with rare bad actors You want to run an A/B test on a new anti-spam intervention. Spammers make up a very small fraction of all senders. How do you set up the test so that the few high-risk accounts are distributed evenly, the required sample size stays manageable, and the guardrail metrics for normal users remain meaningful?
Explain your reasoning at each step, call out trade-offs, and state any assumptions you make.
Hints
Hint 1
Report rate has two parts — numerator and denominator. Before concluding spam dropped, ask what changed on each side and whether the denominator shifted for reasons unrelated to spam.
Hint 2
When spammers are rare, including all users in your analysis dilutes the signal dramatically. Think about which users the treatment could actually affect, and restrict your primary analysis to them.
Hint 3
Pairing every spam metric with a matching user-harm guardrail keeps the analysis honest — an intervention that harms normal senders may still look good on spam-only metrics.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
What a strong answer covers
The interviewer is probing three things: whether you can measure a hidden quantity through behavior, whether you diagnose a metric movement rather than accept it at face value, and whether you know how to run a valid experiment on a rare, adversarial population. A complete answer pairs every spam signal with a corresponding normal-user guardrail, because an intervention that suppresses spam by also suppressing legitimate messaging is not a win.
Part 1: Behavioral proxies when no classifier exists
Group signals by whose behavior they reflect.
Supply-side signals (spam being sent)
- Messages sent per sender per day, looking at the distribution tail (p95, p99) rather than the mean. Spammers concentrate in the extreme tail.
- Unique recipients per sender (fan-out), especially the share of those recipients who have no prior connection to the sender.
- Content duplication rate: the share of messages whose text or link fingerprint appears identically across more than N senders. Legitimate users send original messages; spam campaigns reuse templates.
- Link rate and domain novelty: share of messages containing URLs, broken down by domain age or rarity.
- New-account message volume: messages from accounts under 7 days old as a share of total, since most real users do not become heavy messengers immediately.
Demand-side signals (spam being experienced)
- Report rate per message delivered and separately per message viewed. The two denominators tell different stories (more on this in Part 2).
- Block rate after receiving a message request.
- Ignore-without-opening rate on message requests.
- Message-request acceptance rate segmented by whether sender and recipient have mutual connections.
- Reply rate: legitimate conversations get responses; spam rarely does.
- Sampled human-labeled prevalence: label a small random draw of messages weekly and compute the share that reviewers call spam. This is slow and costly but it is ground truth, and it calibrates every proxy.
Guardrails for normal users
- Messages sent and conversations started per daily active user, restricted to low-risk senders (account age over 90 days, no prior reports).
- Reply rate and request acceptance rate for that same cohort.
- Appeal rate and appeal-overturn rate as a proxy for false positives.
Normalize everything per 1,000 messages delivered or per recipient. Raw counts just track traffic growth.
Part 2: Report rate fell — what does it mean?
Report rate = reports ÷ messages. A drop could mean spam decreased, or it could mean several other things. Decompose before concluding anything.
Real improvement: less spam is actually being sent or reaching inboxes. This should show up simultaneously in labeled prevalence, the fan-out tail, duplicate-content rate, and block rate. If all of these fall together, the improvement is probably real.
Denominator inflation: a product change or seasonal event drove up legitimate message volume without changing spam volume. Recompute reports per recipient and reports per active user rather than per message. If those hold flat, the raw rate drop is a composition artifact.
Exposure change: spam is now routed to a filtered folder that users rarely open. Report rate per message viewed will stay the same or rise even as rate per message delivered falls. Check filtered-folder volume and open rate.
UI friction: a redesign buried the report button or broke the reporting flow. Pull the report funnel (menu opened → report tapped → submission completed) segmented by app version. A funnel drop with no corresponding change in labeled prevalence is a strong signal.
Reporter composition shift: growth from markets or cohorts with historically low reporting propensity dilutes the aggregate rate. Run a mix-shift decomposition: hold segment weights fixed and see how much of the drop is within-segment improvement versus compositional change.
Adversarial adaptation: spammers switch to targeting new users who do not report, reduce volume to avoid detection, or migrate to adjacent surfaces. Check report rate within fixed recipient-tenure cohorts, and monitor spam proxies on comments or other surfaces.
Logging or pipeline issues: always rule this out first. Compare client-side event counts to server-side and check whether the review queue size moved.
The diagnostic sequence: check logging, recompute with alternate denominators, segment by surface/country/app version/tenure, run the mix-shift decomposition, and triangulate with block rate and labeled prevalence. If reports fell but blocks and ignores are flat or rising, spam did not decrease.
Part 3: A/B test when spammers are rare
Choose the randomization unit based on where the intervention sits. A sender-side intervention (rate limits, flow restrictions) should randomize senders. A recipient-side intervention (inbox filtering) should randomize recipients. The key risk is interference: under sender randomization, a recipient may receive messages from accounts in both arms, contaminating recipient-side metrics. If interference is severe, escalate to cluster or geo randomization at the cost of statistical power.
Stratify before randomizing. Use risk proxies from Part 1 — account age bucket, fan-out decile, prior report and block counts, country — to form strata, then randomize within each stratum. Without this, the small number of prolific spammers can land unevenly across arms by chance and dominate results.
Use triggered analysis. Restrict the primary analysis to users the treatment could actually affect: senders who crossed a fan-out threshold, or recipients who received a message from a new high-fan-out account. Including untouched users inflates the denominator roughly by 1/(trigger rate) and multiplies required sample size by the same factor. If only 0.5% of senders are triggered, analyzing all senders requires ~200× the sample size for the same power.
Size the experiment. Example: triggered recipients have a 2% baseline report rate; you want to detect a 10% relative reduction (0.2 percentage points) at α = 0.05, 80% power.
n per arm ≈ 2 × (1.96 + 0.84)² × p(1−p) / δ²
= 2 × 7.84 × 0.0196 / (0.002)²
≈ 77,000 triggered recipients per arm
To reduce variance further, apply CUPED using pre-period report and block rates as covariates. Analyze per-user ratio metrics with the delta method rather than pooled per-message rates, since a handful of heavy senders would otherwise inflate variance.
Define success criteria upfront. Primary metrics: reports and blocks per triggered recipient; labeled prevalence from a sampled human review in each arm. Guardrails on established, low-risk senders: send volume, reply rate, request acceptance rate, appeal and overturn rate. Pre-register a non-inferiority margin on the guardrails (for example, no more than a 0.5% relative drop in messages sent per normal user) so the team cannot move the goalposts after seeing results.
Common mistakes to avoid. Ignoring interference between arms. Forgetting to check guardrails and shipping an intervention that harms normal users while spam metrics look fine. Treating a report-rate drop as success without triangulating against labeled prevalence and other proxies. Running the power calculation on the full population rather than the triggered subset.