Google SQL interview prep

Google SQL
Interview Questions

Practice the exact SQL patterns Google asks in L3-L6 data analyst and data engineer interviews. Window functions, CTEs, BigQuery-style queries, and optimization — with AI tutoring.

Practice the 32 Google-tagged challenges — 14 free See all 32 Google-tagged challenges ↓

32 challenges

Google patterns

AI tutor

Explains every step

No setup

Runs in browser

What this page is: we have no dated public source for how Google runs its SQL round, so this page does not state one — no duration, no platform, no stage list. What follows is general SQL interview practice on the kind of data Google works with. What is ours: the questions are SQL Quest challenges and the topic emphasis is our editorial judgement, not a measured breakdown of Google's interview. Pages with dated sources say so in this spot.

Practice Set Composition

What the Google practice set actually covers

The 32 challenges tagged Google in the SQL Quest bank, with every raw challenge tag resolved to the 9 canonical skills. Each share is the portion of those 32 challenges that exercise the skill — a challenge exercises several, so the shares do not sum to 100%. This is the composition of the practice set on this page, not a measurement of Google’s interview.

Practice Questions

Six SQL Quest challenges matched to Google’s patterns

These are SQL Quest challenges chosen because their SQL matches the work — Querying Basics, Subqueries & CTEs, Aggregation & Grouping. They are not questions Google has asked, and this page does not claim to know its questions. All of the six play free; each card opens the challenge itself.

Open all 32 Google-tagged challenges — 14 play free →

Analyst Round

Window functions in the Google data analyst SQL round

Updated September 2026 · the outputs below come from the same datasets the editor runs

Two shapes account for most of the window-function questions in analyst-style SQL rounds: rank inside a group (top-N per group, dedupe, second-highest per department) and compare a row with its neighbour (month-over-month, streaks, gaps). Both are below, and both run in the editor exactly as written.

1 · ROW_NUMBER — top-N per group

The pattern that shows up in analyst-round questions as "the best / latest / second-highest X for every Y". Number the rows inside each partition, then keep the numbers you want. The WHERE rn <= 2 has to live outside the window — a window function cannot be filtered in the same SELECT that defines it, which is why the CTE is there.

employees · top 2 salaries per departmentRuns free
WITH ranked AS (
  SELECT name, department, salary,
         ROW_NUMBER() OVER (PARTITION BY department ORDER BY salary DESC) AS rn
  FROM employees
)
SELECT department, name, salary, rn
FROM ranked
WHERE rn <= 2
ORDER BY department, rn
first 4 of 10 rows
departmentnamesalaryrn
EngineeringUlysses Cook1150001
EngineeringEva Martinez1100002
FinanceTeresa Murphy980001
FinancePaul Thompson950002

The trap is ties. ROW_NUMBER breaks them arbitrarily and always returns exactly N rows per group; DENSE_RANK lets tied salaries share a rank, so "second highest" can return two people. Say which one the question wants before you write it — that sentence is usually worth more than the query.

2 · LAG — month-over-month growth

The pattern behind every "how did this month compare to last month" question: aggregate to one row per period first, then reach back one row with LAG. Doing the LAG over raw orders compares orders, not months — the GROUP BY has to happen in the first CTE.

orders · revenue per month vs the month beforeRuns free
WITH monthly AS (
  SELECT strftime('%Y-%m', order_date) AS month,
         SUM(total) AS revenue
  FROM orders
  GROUP BY 1
),
with_prev AS (
  SELECT month, revenue,
         LAG(revenue) OVER (ORDER BY month) AS prev_revenue
  FROM monthly
)
SELECT month, revenue, prev_revenue,
       ROUND(100.0 * (revenue - prev_revenue) / prev_revenue, 1) AS mom_pct
FROM with_prev
ORDER BY month
2 rows — the practice dataset holds two months
monthrevenueprev_revenuemom_pct
2024-014471.81NULLNULL
2024-023684.634471.81-17.6

The trap is the first row. LAG has nothing to look back at, so prev_revenue is NULL and the division comes out NULL rather than erroring — which is fine, as long as you say so. The same two-step (period aggregate, then LAG) is also how consecutive-day streaks and gap detection start; only the PARTITION BY changes.

Google-tagged window-function challenges in the set · 8 of 32 · all Hard, Pro

Salary Percentile Ranking (PERCENT_RANK) · 3-Movie Rolling Average Revenue (ROWS BETWEEN) · Fare Percentile Ranking (NTILE) · Engagement Streaks (LAG, gaps and islands) · Median Salary Without PERCENTILE (ROW_NUMBER) · Customer Lifetime Value Pipeline (NTILE) · Department Salary Percentile Buckets (NTILE) · Second Highest Salary per Department (DENSE_RANK)
Practice the Google set →
How To Prepare

How to prepare for an analytics SQL round

General guidance about analytics SQL work — not sourced from Google and not a description of its process. We have no dated, citable source for how Google runs its SQL round, so this page states none.

Skillmap

How ready are you for the Google SQL round?

Ten questions, no signup. You get a readiness score weighted to the SQL this page covers, your Skillmap across joins, window functions, aggregation and the rest, and the weakest skill to practise first.

Check my Google readiness Start the Google set

Google SQL Interview FAQ

Drill the skills the Google set leans on, one at a time: CTE practice · GROUP BY exercises · Window function practice · JOIN practice · CASE WHEN practice — or browse every SQL practice question.

Every question in the Google set, one page each with the schema and a hint: Long-Named Passengers · Department Roster with GROUP_CONCAT · Consistent Director Analysis · Below Department Average · Highest Total Salary Budget Department · Title Social Survival Analysis · Above-Average Departments (Derived Table) · EXISTS vs IN: Departments with Top Performers · Genres Without Blockbusters · Email Provider Customer Analysis · Management Hierarchy Overview · Departments With High Earners · Director Consistency Report · Simple Subquery: Above Average · Salary Percentile Ranking · Top Spender Per Country · Employees with Similar Salaries · Highest Fare Per Port · Correlated Subquery: Employees Above Department Median · Passenger Family Survival Analysis · Recursive Team Size Rollup · 3-Movie Rolling Average Revenue · Fare Percentile Ranking · Daily Active Customers · Engagement Streaks (3+ Orders, ≤7-Day Gaps) · Median Salary Without PERCENTILE · Anti-Join Pipeline: Unmatched Records · Customers with Orders in ALL Categories · Customer Lifetime Value Pipeline · Recursive Org Chart Traversal · Department Salary Percentile Buckets · Second Highest Salary per Department.

Ready to ace your
Google SQL interview?

32 Google-tagged challenges with AI tutoring. No signup required. No credit card. Start writing SQL now.

Launch SQL Quest — It's Free

Works on Chrome, Firefox, Safari, Edge · No plugins · No downloads

Interviewing at more than one company? The same patterns carry: Meta · Amazon · Apple · Netflix — or the full company-by-company interview guide.