SQL interview questions · By company
Meta SQL interview questions
For data analyst and data scientist (analytics) roles: what candidates report, and how to practice for it.
SQLRep isn't affiliated with or endorsed by Meta. This guide summarizes public candidate reports and prep guides (sources below, checked November 2026). The practice questions are original, written in the reported style; they aren't Meta's actual questions. Processes change, so confirm details with your recruiter.
What candidates report about the process
- A recruiter call, then a technical screen of about 45 minutes with a data scientist: roughly 20 minutes of SQL, then a product question.
- The final loop is usually about four rounds: SQL and data analysis, product sense, statistics or A/B testing, and behavioral.
- Candidates describe the SQL as similar to medium-difficulty practice problems, where speed and correctness both matter.
SQL topics that come up
- Monthly or daily active users, including windows like 'active this month or last'
- Conversion rates from user action logs (view, add to cart, purchase)
- Users whose activity fell sharply over consecutive periods (LAG, date grouping)
- CASE inside aggregates, HAVING versus WHERE, and window functions
- Social-graph questions: mutual connections and friend suggestions
Practice the reported patterns
Each one runs in real PostgreSQL in your browser, with feedback on what's wrong.
- Monthly actives over a two-month windowFor each month from January to May 2025, return month (YYYY-MM), users_this_month (distinct users with activity in that calendar month) and active_users (distinct users with activity in that month or the one before). Show every month, even one with no activity. Sort by month.Pattern: generate_series · rolling window join · COUNT(DISTINCT)HardPro
- View-to-purchase funnel for two productsFor each product, return product, viewers (users who viewed it), carted (viewers who also added it to cart), purchasers (carted users who also bought it) and conversion_pct (purchasers as a % of viewers, rounded to 1 decimal). Count each user once per product. Sort by product.Pattern: Funnel per user · bool_or · COUNT FILTERMediumPro
- Logins halved three months runningTotal each user's logins per calendar month. A month 'fell' if its total is less than half of the same user's previous month. For every month that fell where the two months before it also fell, return user_id, month (YYYY-MM), logins (that month's total) and start_logins (the total three months earlier). Sort by month, then user_id.Pattern: Monthly SUM · LAG · consecutive flagsHardPro
- Creators who post mostly videoReturn handle, posts (all their posts), video_posts and video_share_pct (video_posts as a % of posts, rounded to 1 decimal) for every creator with 5 or more posts whose video share is above 50%. Sort by video_share_pct descending, then handle.Pattern: CASE inside SUM · HAVING on a ratioMediumPro
- Signup-to-purchase funnelReturn step (the event name) and users (distinct users who did it) for signup, view_pricing, checkout and purchase, in that funnel order.Pattern: COUNT(DISTINCT) · funnel stepsMediumPro
- DAU/MAU stickinessFrom app_opens, for each month return month (YYYY-MM), avg_dau (distinct user-days divided by the number of days in that month, rounded to 2 decimals), mau (distinct users that month) and stickiness_pct (100 * user-days / (days in month * mau), rounded to 1 decimal). Oldest first.Pattern: Distinct user-days · days in month · ratiosHardPro
- Day-1 return rateGroup users by cohort_month, the month (YYYY-MM) of their first app open. For each cohort return cohort_month, users (users in the cohort), returned_day_1 (users who also opened the app on the day right after their first open) and day_1_rate (returned_day_1 as a percentage of users, rounded to 2 decimals). Include cohorts where nobody returned. Sort by cohort_month.Pattern: MIN first activity · LEFT JOIN on date + 1MediumPro
- Mutual followsReturn user_a, user_b and mutual_since for every pair of users who follow each other, one row per pair with user_a < user_b. mutual_since is the date of the second of the two follows, when the follow became mutual. Sort by user_a, user_b.Pattern: Self-join on reversed pairsMediumPro
- People you may knowmkt_friendships stores each friendship once, with user_a < user_b. For every user, return user_id, suggested_id and mutual_friends for each person who is not the user, is not already their friend, and shares at least 2 mutual friends with them. Sort by user_id, mutual_friends highest first, then suggested_id.Pattern: Both directions of a pair · two-hop self-join · anti-joinHardPro
- Engagement rate per postReturn post_id, creator_id, engagements (likes + comments + shares, where a NULL shares counts as 0) and engagement_rate_pct (engagements as a percentage of impressions, ROUND(..., 2), NULL when impressions is 0). Sort by engagement_rate_pct highest first with NULLs last, then post_id.Pattern: COALESCE · NULLIF · safe ratiosEasyPro
Tip: The product question follows the SQL, so practice saying which metric your query measures and what would make it move.
Sources
- Interview Query: Meta data analyst guide
- IGotAnOffer: Meta data analyst interview
- Exponent: Meta data scientist interview
- Glassdoor: Meta interview reviews
Meta is a trademark of its owner, used here only to identify the company the reports are about.