Code Room
CodingEasycod-g1362
Subject Ab test mathLevel Entry–Mid~10 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

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) → int
Examples
in[40,1000,55,1000]out150
What 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.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.