A/B Testing

You will understand what A/B testing is, why it exists, how to wire a minimal version into a Spring Boot service, and how to avoid the most common beginner mistakes — so you can ship changes with confidence instead of gut-feel.

The Button Nobody Could Agree On

Picture this: the EngineerPrep team notices that learners often abandon a practice question without asking for help. Someone suggests changing the hint button label. A designer mocks up three options. A product manager has a favourite. An engineer has a different favourite. Everyone has an opinion. Nobody has proof. The natural move is to pick the loudest voice in the room — or whoever is most senior. But that is just guessing with extra steps. What if you could show both versions to real users at the same time, measure which one actually helped more people, and let the numbers decide? That is the question this lesson answers.

The Simple Idea

A/B testing means: split your users into two groups, show group A the old thing and group B the new thing, then measure which group behaves the way you want. That's it. Everything else is detail. A good everyday analogy: imagine a bakery that wants to know whether chocolate-chip cookies or oatmeal cookies sell better at the front counter. On Monday they put chocolate-chip at the front (Group A). On Tuesday they put oatmeal at the front (Group B). They count how many cookies each group sells. The winner goes to the front permanently. (Notice a flaw in that bakery method: Monday and Tuesday customers might differ. Software A/B tests fix this by running both variants simultaneously — which is exactly what we will do.) In software, the version being compared is called a variant .…

See It in Action

Step 1 — A user arrives. Imagine a learner opens the EngineerPrep practice page. At this moment the backend needs to decide: which hint button label should this person see? Step 2 — Assignment. The system hashes the user's ID (turns it into a number) and checks whether that number falls in the bottom half or top half of the range. Bottom half → Group A (control): they see 'Get a Hint'. Top half → Group B (treatment): they see 'Show me a clue'. This happens in milliseconds and the learner never notices. Important: the same user always gets the same variant. If you reassigned randomly on every page load, the user would see a flickering button and your measurement would be noise. Step 3 — The user acts (or doesn't). The learner either clicks the button or skips it. That click — or the absence of one — is recorded as an event .…