Calculate Daily Harmful Content View Percentage
Company: Meta
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Technical Screen
Overview: This question evaluates proficiency in data manipulation and aggregation for computing event-based metrics, testing competency in SQL/Python data processing within the Data Manipulation (SQL/Python) domain.
Tables
VIDEOS(id INTEGER, uploader_id INTEGER, is_harmful BOOLEAN)
VIEWS(video_id INTEGER, user_id INTEGER, view_time TIMESTAMP)
Hints
- Join VIDEOS to VIEWS on video_id = id.
- Compute SUM(CASE WHEN is_harmful THEN 1 ELSE 0 END) / COUNT(*) per day.
Community answers
Answer by SS