Should we push video posts?

MediumMetaleft joinengagement per postconfidence intervalswithin-person comparison· 60 XP (20 per step)

Mock interview. You're interviewing for a data scientist job on a social app's feed team. The interviewer says: "A product manager wants to show more video posts in the feed because 'video gets way more engagement'. Check the claim before we change anything." You have posts and post_actions.

Engagement means a like, comment or share. Reports don't count. Use all posts, and count posts with no actions as 0.

Step 1: Engagement per post by type

"For each post_type, show the number of posts and the average likes, comments and shares per post."

Expected output

  • Columns post_type, posts, likes_per_post, comments_per_post, shares_per_post (rounded to 2 decimals); sorted by post_type

Example of the shape (made-up values):

post_type posts likes_per_post comments_per_post shares_per_post
poll 100 3.00 1.00 0.40

Hints, the later steps and the answer come with Pro.

Step 1 of 3

Write your query here. Ctrl + Enter submits.