Day-One Retention by Signup Date for New Instagram Accounts

Last updated: November 29, 2026

Quick Overview

Given a users table with signup timestamps and an activity log of app opens, return for each signup date the number of new accounts and the share that opened the app again on the calendar day after signup.

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

0

0

0 solved


Given a users table with signup timestamps and an activity log of app opens, return for each signup date the number of new accounts and the share that opened the app again on the calendar day after signup.

This is a common warm-up in Meta's data science technical screen, where the interviewer shares a small schema for Instagram signups and app_opens and asks for a single query. They are checking that you anchor retention on the signup cohort, use a LEFT JOIN so non-returners stay in the denominator, and avoid counting the same user twice.

What the Interviewer Expects
  • Define the cohort from the users table, not from first activity
  • Use a LEFT JOIN so zero-return users stay in the denominator
  • Deduplicate opens so a user counts once
  • Compare dates, not timestamps, for the day offset
  • Return a rate with an explicit cast to avoid integer division
Key Topics to Cover
cohort retention
LEFT JOIN
date arithmetic
deduplication
integer division
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
  • How would you change the query to report Day-1, Day-7 and Day-30 in one pass?
  • What if signup and activity timestamps are in UTC but retention should use the user's local day?
  • How would you exclude cohorts that are not yet mature?
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: users(user_id, signup_ts) with one row per account, and app_opens(user_id, open_ts) with many rows per user. Day 1 means the calendar date after the signup date (UTC for now). An account t...

Approach

Build the cohort first: one row per user with signup_date. Then check for existence of an open on signup_date + 1. Using EXISTS (or a LEFT JOIN against a deduplicated set of user-days) keeps one...


Submit Your Answer
Markdown supported