Meaningful Session Calculation
Let’s say that you’re given event data from users on a social networking site like Facebook.
A product manager is interested in understanding the average number of “sessions” that occur every day. However, the company has not technically defined what a “session” is yet.
The best the product manager can do is illustrate an example of a user browsing Facebook in the morning on their phone and then again during lunch as two distinct “sessions”. In which there must be a period of time where the user leaves Facebook to do another task before coming back again anew.
Given a dataset of raw events, how would you come up with a measurement to define what a “session” is for the company?
Given your definition, write a query to return the average number of sessions per day.