Share of Facebook Group Posts Whose First Comment Came From an Admin

Last updated: November 29, 2026

Quick Overview

For each Facebook Group, compute the share of posts whose first comment (excluding the post author's own comments) came from a current group admin, and the median minutes from post creation to that first comment.

Meta
Data Manipulation (SQL/Python)
Data Scientist
Meta
November 29, 2026
Data Scientist
Technical Screen
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


For each Facebook Group, compute the share of posts whose first comment (excluding the post author's own comments) came from a current group admin, and the median minutes from post creation to that first comment.

Admin engagement is a known driver of healthy Groups, and Meta's Groups team tracks how often admins are first to respond. The interviewer checks ROW_NUMBER over comments per post, the exclusion of self-comments before ranking, and keeping uncommented posts in the denominator.

What the Interviewer Expects
  • Excludes the post author's own comments before choosing the first comment
  • Uses ROW_NUMBER per post ordered by comment time
  • Joins the first commenter against the admin table on both group and user
  • Keeps posts with no qualifying comment in the denominator
  • Computes a median latency with PERCENTILE_CONT
Key Topics to Cover
ROW_NUMBER
first event per entity
exclusion before ranking
LEFT JOIN
PERCENTILE_CONT
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • Admins change over time. How would you use an admin history table to check admin status at comment time?
  • How would you test whether admin-first responses increase later member engagement on the post?
  • How would you rank groups where admins respond quickly but rarely?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

Tables:

  • group_posts(post_id, group_id, author_id, created_at)
  • post_comments(comment_id, post_id, author_id, created_at)
  • group_admins(group_id, user_id), current admins and moderators....
Approach

Join comments to posts, drop rows where the commenter is the post's author, rank the rest per post by time, and keep rank 1. Left join from posts so posts with no qualifying comment still count. Flag ...


Submit Your Answer
Markdown supported