Meta SQL Interview
Questions

Practice the exact SQL patterns Meta uses to screen data analysts and data engineers. Window functions, retention analysis, DAU/MAU — with real datasets and AI-powered hints.

Practice Meta SQL Questions Free →

Used by engineers preparing for Meta data roles

What SQL questions does Meta ask?

Meta's data interviews focus on user behaviour analysis — the kind of queries a data analyst runs against Meta's core products. Based on hundreds of interview reports, these are the most common patterns:

Hard

User Retention Analysis

Given a logins table with timestamps, calculate the Day-1 and Day-7 retention rate for a cohort of users who joined in January.

Uses: LAG() DATEDIFF COUNT(DISTINCT) self-join

Practice this →
Medium

DAU / MAU Ratio

Calculate the daily active users to monthly active users ratio for each day. Return days where the ratio fell below 0.1.

Uses: COUNT(DISTINCT) DATE_TRUNC window frames

Practice this →
Hard

Friend Recommendations

From a friendships table, find users who share at least 2 mutual friends but are not currently connected.

Uses: self-join NOT EXISTS HAVING COUNT

Practice this →
Medium

Consecutive Active Days

Find all users active for at least 3 consecutive days in Q1. Return user IDs and the start of their longest streak.

Uses: ROW_NUMBER() date arithmetic gaps-and-islands

Practice this →
Medium

Ad Click Funnel

Given impression and click event tables, calculate click-through rate by ad type and identify the lowest-performing categories.

Uses: LEFT JOIN COALESCE CTR calculation

Practice this →
Easy

Running Total of Posts

For each user, calculate a cumulative count of posts ordered by date. Return the user, post date, and running total.

Uses: SUM() OVER (PARTITION BY ... ORDER BY ...)

Practice this →
See all Meta SQL questions →

SQL concepts Meta tests most

Window functions

ROW_NUMBER(), RANK(), LAG(), LEAD(), SUM() OVER — Meta uses these in almost every hard question.

Practice window functions →

Date arithmetic

Retention and streak queries require confident date handling. Know DATEDIFF, DATE_TRUNC, and INTERVAL cold.

Practice date functions →

Self-joins

Friend graphs and sequential event comparisons require joining a table to itself. Practice this separately — it trips up many candidates.

Practice joins →

CTEs for readability

Structure complex queries with WITH clauses. Meta interviewers expect clean SQL — a deeply nested subquery is a red flag.

Practice CTEs →

How to prepare for Meta's SQL interview

  1. Master window functions first. They appear in the majority of Meta's hard SQL questions. Start with ROW_NUMBER() and LAG(), then move to frame clauses.
  2. Practice retention and cohort queries. Meta cares deeply about user behaviour over time. Learn Day-N retention queries, rolling averages, and cohort comparisons.
  3. Write clean SQL, not just correct SQL. Meta interviewers evaluate readability. Use CTEs instead of nested subqueries and explain your reasoning aloud.
  4. Time yourself. Meta's SQL screen gives 20–30 minutes per question. Practice under time pressure so you can write and explain simultaneously.

Ready to start practicing?

SQL Quest includes all the Meta patterns above with AI hints and real data. Free to start — no credit card.

Start Meta SQL Practice Free →

Also preparing for other companies?