PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates proficiency in SQL data manipulation—specifically joins, aggregations, time-window filtering, and counting/averaging event-driven metrics—within the Data Manipulation (SQL/Python) domain.

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

Count unconnected posts and reactions

Company: Meta

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Technical Screen

You are analyzing a newly launched feed feature intended to improve engagement by showing more unconnected content. Assume the following tables: - `posts(post_id BIGINT, view_id BIGINT, relationship VARCHAR, post_date DATE)` - Each row represents one post impression in a user's feed. - `relationship` describes the relationship between the viewer and the post author. - Relevant values include `'friend'` and `'unconnected'`. - `interactions(interaction_id BIGINT, view_id BIGINT, interaction_type VARCHAR, interaction_ts TIMESTAMP)` - Each row represents one interaction on a feed impression. - `interaction_type` can be `'like'` or `'comment'`. - `view_id` joins to `posts.view_id`. Assume all dates and timestamps are in UTC. Interpret "last 7 days" as the inclusive window from `CURRENT_DATE - INTERVAL '6 day'` through `CURRENT_DATE`. Write SQL for the following: 1. Count how many feed impressions were for unconnected content in the last 7 days. - Output column: `unconnected_post_count` 2. For feed impressions in the last 7 days, compute the average number of reactions (`like` + `comment`) per impression for `friend` and `unconnected` content. - Include impressions with zero reactions. - Output columns: `relationship`, `avg_reactions_per_post`

Quick Answer: This question evaluates proficiency in SQL data manipulation—specifically joins, aggregations, time-window filtering, and counting/averaging event-driven metrics—within the Data Manipulation (SQL/Python) domain.

Last updated: May 7, 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 heavy callers in 7 days - Meta (medium)
  • Write SQL for call metrics - Meta (medium)
  • Write SQL for multi-account metrics - Meta (medium)
  • Count Recent High-Volume Call Users - Meta (medium)