Product-led growth strategies in Digital Marketing - Time & Space Complexity
When analyzing product-led growth strategies, it helps to understand how the effort or cost grows as the number of users or features increases.
We want to know how the time or resources needed change as the product scales.
Analyze the time complexity of the following simplified process for onboarding users in a product-led growth strategy.
for user in new_users:
send_welcome_email(user)
if user_activates_feature(user):
add_to_active_users(user)
update_metrics()
This code sends welcome emails, checks if users activate a feature, and updates metrics for each new user.
Look at what repeats as the number of new users grows.
- Primary operation: Looping through each new user to send emails and check activation.
- How many times: Once for every new user, so the number of times equals the number of new users.
As the number of new users increases, the total work grows in a straight line.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 | About 10 emails sent and checks done |
| 100 | About 100 emails sent and checks done |
| 1000 | About 1000 emails sent and checks done |
Pattern observation: Doubling the users doubles the work needed.
Time Complexity: O(n)
This means the time or effort grows directly in proportion to the number of new users.
[X] Wrong: "Adding more users won't increase the time much because emails are automated."
[OK] Correct: Even if automated, each user still requires a separate email and check, so total work grows with user count.
Understanding how tasks scale with user growth shows you can think about product processes efficiently, a useful skill in many marketing and product roles.
What if we batch welcome emails instead of sending one per user? How would the time complexity change?