PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates proficiency in data manipulation and analytics using SQL and Python, including aggregations, grouping, joins, and handling time-based event data to compute engagement metrics.

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

Calculate Engagement Metrics for Info-Stream Content Analysis

Company: Meta

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

info_stream_views +----------+-----------+--------------+----------+------------+ | post_id | viewer_id | relationship | duration | ds | +----------+-----------+--------------+----------+------------+ | 101 | 9001 | Friend | 85.4 | 2023-09-18 | | 102 | 9002 | Unconnected | 63.0 | 2023-09-19 | | 103 | 9003 | Followee | 12.0 | 2023-09-20 | | 104 | 9004 | Unconnected | 70.1 | 2023-09-20 | +----------+-----------+--------------+----------+------------+ ​ post_reactions +----------+-----------+-------------+------------+ | post_id | viewer_id | post_action | ds | +----------+-----------+-------------+------------+ | 101 | 9001 | like | 2023-09-18 | | 102 | 9002 | comment | 2023-09-19 | | 102 | 9003 | like | 2023-09-19 | | 104 | 9004 | reshare | 2023-09-20 | +----------+-----------+-------------+------------+ ##### Scenario Analyst must write SQL/Python to understand engagement with info-stream content over the last week. ##### Question Using the tables below, write a query to compute the number of DISTINCT posts that received more than 60 seconds of viewing time from unconnected audiences in the past 7 days. Write a second query that returns the average number of reactions per post coming from (a) friends and (b) unconnected viewers during the past 7 days. ##### Hints Filter ds for last 7 days, group by relationship, count distinct post_id for first query, aggregate reactions and divide by distinct posts for second.

Quick Answer: This question evaluates proficiency in data manipulation and analytics using SQL and Python, including aggregations, grouping, joins, and handling time-based event data to compute engagement metrics.

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)