A Collection of Data Science Take-Home Challenges

User Referral Program


Almost all sites have a user referral program: you can invite new users to try a given product. Typically, after the new referred user completes a transaction, you get rewarded with a certain amount of money or credit to be used on the site.

The goal of this challenge is to analyze the data from a referral program and draw conclusions about its effectiveness.

Challenge Description

Company XYZ has started a new referral program on Oct, 31. Each user who refers a new user will get 10$ in credit when the new user buys something.

The program has been running for almost a month and the Growth Product Manager wants to know if it's been successful. She is very excited cause, since the referral program started, the company saw a spike in number of users and wants you to be able to give her some data she can show to her boss.


We have just 1 table downloadable by clicking here.

The table is:

    referral - provides information about each transaction that happens on the site and whether the user came from the referral program or not.



    Let's check one purchase event

head (referral, 1)

Column Name Value Description
user_id 2 this is the user id
date 2015-10-03 she bought something on Oct, 3
country FR she is in France
money_spent 65 She spent 65$
is_referral 0 she didn't come via the referral program
device_id EVDCJTZMVMJDG she used a device identified by this id to make the purchase

    Let's now also check one purchase event from a user who came via the referral program

head(subset(referral,is_referral==1), 1)

Column Name Value Description
user_id 5016 this is the user
date 2015-10-31 she bought on Oct, 31
country DE she is in German
money_spent 45 it cost 45$
is_referral 1 she joined the site via another user referral
device_id OGAZARJAGCPUQ this is the device she used to complete the purchase

Click here for mock phone interviews to practice similar questions, DS takehome challenges, and more