A/B Test Winner (Practical Rule)

Medium ⏱ 12 min 45% acceptance ★★★★☆ 4.2
Write ab_winner(a_visits, a_conversions, b_visits, b_conversions) returning 'A', 'B' or 'inconclusive' using a practical product rule: a variant wins when its conversion rate beats the other's by at least 20% relatively AND both variants have 100+ visits. (Real significance testing comes later; this is the guardrail PMs actually use first.)

Examples

Example 1
Input
ab_winner(500, 50, 500, 65)
Output
'B'
Explanation

13% vs 10% — a 30% relative lift with ample traffic.

Constraints

  • Both arms need >= 100 visits, else inconclusive.
  • Relative lift, not absolute points.

Topics

Business Logicexperimentation

Companies

MetaNetflixBooking.com

Hints

Hint 1

rate = conversions / visits.

Hint 2

b_rate >= a_rate * 1.2 declares B.

Loading the Python runtime… Run executes your code and shows printed output; Submit checks your function against this problem's examples.