Share of New Threads Users Following Five Accounts in a Week
Last updated: November 29, 2026
Quick Overview
Write SQL that, for each weekly signup cohort on Threads, returns the number of new users and the share who followed at least five distinct accounts within seven days of signing up.
Meta
November 29, 20260
0
0 solved
Write SQL that, for each weekly signup cohort on Threads, returns the number of new users and the share who followed at least five distinct accounts within seven days of signing up.
Early follow counts are a standard activation signal for social apps like Threads, where an empty feed predicts churn. This phone-screen style question checks cohort grouping, a per-user window relative to signup, LEFT JOIN to keep zero-follow users, and DISTINCT on re-follows.
What the Interviewer Expects
- Groups users into signup week cohorts
- Counts follows in a window relative to each user's own signup time
- Keeps users with zero follows
- Uses COUNT DISTINCT to ignore repeated follow events
- Excludes cohorts whose window is incomplete
Key Topics to Cover
How to Approach This
- Clarify the schema and expected output format before writing queries.
- Use CTEs (WITH clauses) to break complex queries into readable steps.
- Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
- Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
- For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
- How should unfollows within the week be handled?
- How would you show the full distribution of follow counts?
- How would you test whether reaching five follows causes better retention?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice SQL ProblemsSample Answer
Clarify the Data
Tables: users(user_id, signup_at) and follows(follower_id, followee_id, followed_at). A user may follow, unfollow, and re-follow the same account, producing repeated rows; I will count distinct fo...
Approach
For each user, count distinct followees with followed_at in . LEFT JOIN so users with no follows get 0. Then group by cohort week and average a 0/1 indica...