Calculate Response Rate and Compare New vs. Existing User Scores
Company: Meta
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: Medium
Interview Round: Technical Screen
survey_events
+---------+------------+-----------+--------------+---------------------+
| user_id | is_new_user| responded | survey_score | event_time |
+---------+------------+-----------+--------------+---------------------+
| 101 | true | true | 5 | 2023-11-01 10:00:00 |
| 102 | false | false | NULL | 2023-11-01 10:05:00 |
| 103 | true | true | 4 | 2023-11-01 10:10:00 |
| 104 | false | true | 3 | 2023-11-01 10:20:00 |
| 105 | true | false | NULL | 2023-11-01 10:30:00 |
+---------+------------+-----------+--------------+---------------------+
##### Scenario
Product team ran an in-app survey and stored results in a table; they need response rate and to know if new users provide better survey scores.
##### Question
Write SQL to calculate the overall survey response rate. Write SQL to compare average survey_score between new and existing users and test if the difference is significant.
##### Hints
Use conditional aggregation or CTEs; remember NULL handling.
Quick Answer: This question evaluates data manipulation and statistical analysis skills for a data scientist, focusing on SQL aggregation, NULL handling, cohort comparison, and testing differences in survey scores.