PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Data Manipulation (SQL/Python)/Meta

Compute daily post success rate for last 7 days

Last updated: Mar 29, 2026

Quick Overview

This question evaluates data manipulation and analytical competencies in Data Manipulation (SQL/Python), focusing on time-windowed aggregations, rate calculations, handling nulls/zero denominators, numeric type and rounding considerations, and producing per-calendar-date outputs.

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

Compute daily post success rate for last 7 days

Company: Meta

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

You have a table composer(user_id INT, event STRING CHECK(event IN ('enter','post','cancel')), event_date DATE). Compute the post success rate for each calendar date in the last 7 days, taking "today" as 2025-09-01 (so the window is 2025-08-26 through 2025-09-01, inclusive). Define daily post success rate = count(event='post') / NULLIF(count(event='enter'), 0) computed per event_date. Requirements: 1) Output one row per date in the window even if there is no activity that day (use 0.00 when enters=0). 2) Return columns: event_date, post_success_rate (rounded to 2 decimals). 3) Avoid integer division. 4) Treat duplicate events from the same user independently (do not de-duplicate users). 5) Do not assume referential integrity across days. Example sample data: composer user_id | event | event_date 1 | enter | 2025-08-26 1 | post | 2025-08-26 2 | enter | 2025-08-26 3 | enter | 2025-08-27 3 | cancel | 2025-08-27 4 | enter | 2025-08-29 4 | post | 2025-08-29 5 | post | 2025-08-30

Quick Answer: This question evaluates data manipulation and analytical competencies in Data Manipulation (SQL/Python), focusing on time-windowed aggregations, rate calculations, handling nulls/zero denominators, numeric type and rounding considerations, and producing per-calendar-date outputs.

Related Interview 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)
Meta logo
Meta
Oct 13, 2025, 9:49 PM
Data Scientist
Technical Screen
Data Manipulation (SQL/Python)
5
0

You have a table composer(user_id INT, event STRING CHECK(event IN ('enter','post','cancel')), event_date DATE). Compute the post success rate for each calendar date in the last 7 days, taking "today" as 2025-09-01 (so the window is 2025-08-26 through 2025-09-01, inclusive). Define daily post success rate = count(event='post') / NULLIF(count(event='enter'), 0) computed per event_date. Requirements: 1) Output one row per date in the window even if there is no activity that day (use 0.00 when enters=0). 2) Return columns: event_date, post_success_rate (rounded to 2 decimals). 3) Avoid integer division. 4) Treat duplicate events from the same user independently (do not de-duplicate users). 5) Do not assume referential integrity across days. Example sample data:

composer user_id | event | event_date 1 | enter | 2025-08-26 1 | post | 2025-08-26 2 | enter | 2025-08-26 3 | enter | 2025-08-27 3 | cancel | 2025-08-27 4 | enter | 2025-08-29 4 | post | 2025-08-29 5 | post | 2025-08-30

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Data Manipulation (SQL/Python)•More Meta•More Data Scientist•Meta Data Scientist•Meta Data Manipulation (SQL/Python)•Data Scientist Data Manipulation (SQL/Python)
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.