A/B testing landing pages in Digital Marketing - Time & Space Complexity
Start learning this pattern below
Jump into concepts and practice - no test required
When running A/B tests on landing pages, it's important to understand how the time to get results grows as you increase the number of visitors or variations.
We want to know how the testing process scales with more data and options.
Analyze the time complexity of this simplified A/B testing process.
for each visitor in visitors:
assign visitor to a landing page variant
record visitor action (click or no click)
calculate conversion rate for each variant
compare conversion rates to find the best
This code assigns visitors to different landing page versions, tracks their actions, and then compares results.
Look for repeated steps that take most time.
- Primary operation: Looping through each visitor to assign and record actions.
- How many times: Once for every visitor, so the number of visitors (n).
As the number of visitors grows, the time to process them grows too.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 | About 10 assignments and recordings |
| 100 | About 100 assignments and recordings |
| 1000 | About 1000 assignments and recordings |
Pattern observation: The work grows directly with the number of visitors.
Time Complexity: O(n)
This means the time to complete the test grows in a straight line as more visitors participate.
[X] Wrong: "Adding more landing page variants will multiply the time by the number of variants squared."
[OK] Correct: Each visitor is assigned to only one variant, so time grows mainly with visitors, not variants squared.
Understanding how testing scales helps you design experiments that finish in reasonable time and handle more visitors smoothly.
"What if we tracked multiple actions per visitor instead of just one? How would the time complexity change?"
Practice
Solution
Step 1: Understand the goal of A/B testing
A/B testing is used to compare two versions of a webpage to see which one works better for visitors.Step 2: Identify the correct purpose
Among the options, only comparing two versions to find the better one matches the goal of A/B testing.Final Answer:
To compare two versions and find which performs better -> Option AQuick Check:
A/B testing purpose = Compare versions [OK]
- Thinking A/B testing creates many unrelated pages
- Confusing A/B testing with website speed optimization
- Assuming A/B testing is for design tasks like logos
Solution
Step 1: Review proper A/B testing setup
A/B testing requires splitting visitors randomly to fairly compare two versions.Step 2: Identify the correct step
Only randomly splitting visitors between two versions is a correct and essential step.Final Answer:
Randomly split visitors between two page versions -> Option CQuick Check:
Visitor split = Random between versions [OK]
- Testing many changes at once causing unclear results
- Changing whole website instead of just landing pages
- Ignoring real visitor data during the test
Solution
Step 1: Compare conversion rates of both versions
Version A has 5% and version B has 7%, so B performs better.Step 2: Decide based on performance
Choose the version with the higher conversion rate to improve results.Final Answer:
Version B because it has a higher conversion rate -> Option BQuick Check:
Higher conversion rate = Better version [OK]
- Choosing version tested first instead of better performing
- Ignoring small but meaningful conversion differences
- Continuing to show both versions without decision
Solution
Step 1: Understand the problem with multiple changes
Changing more than one element at once confuses which change caused the result.Step 2: Identify the main issue
The main problem is losing clarity on which change improved or hurt performance.Final Answer:
It makes it impossible to know which change affected results -> Option AQuick Check:
Multiple changes = unclear results [OK]
- Believing multiple changes speed up or clarify tests
- Thinking fewer visitors are needed with many changes
- Confusing test changes with website speed improvements
Solution
Step 1: Analyze the conversion difference
Version A has 5% conversion (50/1000), Version B has 5.5% (55/1000). The difference is small.Step 2: Decide based on data size and difference
Small differences with limited visitors need more data for reliable results.Final Answer:
Run the test longer to collect more data before deciding -> Option DQuick Check:
Small difference + limited data = test longer [OK]
- Choosing winner too soon with small data
- Changing multiple elements before finalizing test
- Ignoring test results and guessing
