Conversion rate uplift
The experiment readout shows how many basis points of conversion the variant gained (or lost) over control. Compute each arm's conversion rate in basis points as floor(10000 * conversions / visitors), then return variant_bps - control_bps. The difference may be negative. Both visitor counts are at least 1. Example: control converted 40 of 1000 visitors (400 bps) and the variant 55 of 1000 (550 bps), so return 150.
Implement
uplift_bps(control_conv: int, control_visitors: int, variant_conv: int, variant_visitors: int) → intExamples
in
[40,1000,55,1000]out150What a strong answer looks like
State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
0:00 of about 10 min
solution.py
InputExpectedGot
[40,1000,55,1000]150not run yetsample