Quick Overview

This question evaluates data wrangling and aggregation competency in pandas, focusing on group-level aggregation and filtering of engagement metrics across users and story types.

Compute User Group Stories and Aggregate Story Engagement

Company: Snapchat

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Onsite

user_story_engagement +---------+----------+------------+------------+-------+-------+ | user_id | story_id | story_type | created_at | views | likes | +---------+----------+------------+------------+-------+-------+ | 101 | 555 | regular | 2023-07-01 | 8 | 2 | | 102 | 556 | group | 2023-07-02 | 15 | 4 | | 101 | 557 | group | 2023-07-03 | 5 | 1 | | 103 | 558 | regular | 2023-07-03 | 20 | 10 | +---------+----------+------------+------------+-------+-------+ ##### Scenario Python (pandas) task on story-engagement data to assess data wrangling skills. ##### Question Using pandas, compute the number of group stories each user has posted and return only users with at least three group stories. Aggregate total views and likes per story_type (regular vs group). ##### Hints Use groupby, size/count, sum, reset_index, filtering with query or boolean masks.

Quick Answer: This question evaluates data wrangling and aggregation competency in pandas, focusing on group-level aggregation and filtering of engagement metrics across users and story types.

Loading coding console...