PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates SQL data-manipulation and analytics competencies, including aggregation, DISTINCT counting, joins between view and action logs, date-range filtering, and conditional metric computation from event data.

  • Medium
  • Meta
  • Data Manipulation (SQL/Python)
  • Data Scientist

Analyze Social Media Engagement with SQL Queries

Company: Meta

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

info_stream_views +----------+---------+-----------+-------------------------+-----------------------+------------+ | view_id | post_id | viewer_id | creator_connection_type | view_duration_seconds | view_date | +----------+---------+-----------+-------------------------+-----------------------+------------+ | 101 | 9001 | 501 | friend | 15 | 2023-09-18 | | 102 | 9001 | 777 | unconnected | 25 | 2023-09-18 | | 103 | 9002 | 502 | unconnected | 40 | 2023-09-19 | | 104 | 9003 | 501 | friend | 10 | 2023-09-20 | | 105 | 9002 | 888 | unconnected | 30 | 2023-09-20 | +----------+---------+-----------+-------------------------+-----------------------+------------+ ​ post_action +-----------+---------+-------------+----------+-------------+ | action_id | post_id | action_type | actor_id | action_date | +-----------+---------+-------------+----------+-------------+ | 5001 | 9001 | react | 501 | 2023-09-18 | | 5002 | 9002 | react | 777 | 2023-09-19 | | 5003 | 9002 | comment | 888 | 2023-09-19 | | 5004 | 9003 | react | 502 | 2023-09-20 | | 5005 | 9001 | share | 501 | 2023-09-18 | +-----------+---------+-------------+----------+-------------+ ##### Scenario A social-media analytics task using info_stream_views and post_action tables. ##### Question Write a query to find the number of DISTINCT post_id that accumulated more than 60 seconds of total view_duration_seconds from unconnected viewers during the past 7 days. 2. Write a query to compute the average number of total reactions (action_type = 'react') received by (a) friend-created posts and (b) unconnected‐creator posts in the last 7 days. ##### Hints Use date filtering on the last 7 days, group by post_id, and JOIN the two tables for reactions.

Quick Answer: This question evaluates SQL data-manipulation and analytics competencies, including aggregation, DISTINCT counting, joins between view and action logs, date-range filtering, and conditional metric computation from event data.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Compute ad impression conversion rates - Meta (medium)
  • Count unconnected posts and reactions - Meta (medium)
  • Count heavy callers in 7 days - Meta (medium)
  • Write SQL for call metrics - Meta (medium)
  • Write SQL for multi-account metrics - Meta (medium)