Snap·Data Scientist·Technical Phone Screen
- Write a SQL query that returns each of the last 7 calendar days along with the same-day acceptance rate, defined as the number of approvals where the approval date equals the request date divided by total requests on that date.
- Write a SQL query to find the percentage of friendship requests from last week that did NOT come from accounts flagged as spam.
- The Users table may not contain all users. Propose at least one data or query change to make the previous queries more robust, and describe the key hypotheses and edge cases you would validate when interpreting results.
“The DATE(request_ts) = DATE(approval_ts) condition is the actual crux here and I almost forgot to scope it that way.”