Загрузка...

FAANG SQL Interview Pattern #3 — Cumulative & Running Aggregates

Check out the Book to crack FAANG Data Engineering Here - https://topmate.io/manjinder_brar/

Follow me on LinkedIn - https://www.linkedin.com/in/manjinder-singh-data/

Cumulative and Running Aggregates: the pattern that shows up in almost every SQL interview at Amazon, Netflix, Stripe, and beyond. If an interviewer asks you to show "how a metric grows over time" — this is the pattern they want.

In this episode, we go beyond basic window functions and dive into FRAME SPECIFICATIONS: the secret sauce that makes running totals, cumulative sums, and progressive metrics possible in a single elegant query.

You'll learn:
• How a window function differs from a regular GROUP BY
• The exact syntax: SUM() OVER + ORDER BY + ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
• PARTITION BY for per-group running totals
• The 4 pitfalls that separate good answers from great ones (ROWS vs RANGE, missing ORDER BY, NULL handling, the self-join trap)
• Two real FAANG interview questions, solved step by step

⏱️ TIMESTAMPS

00:00 — Opening Hook: The Amazon SQL Interview
01:12 — Core Concept: From GROUP BY to Window Functions
03:33 — SQL Syntax Deep Dive: SUM OVER, ORDER BY, Frame Specifications, PARTITION BY
07:16 — Common Pitfalls: ROWS vs RANGE, Missing ORDER BY, NULLs, Self-Join Trap
11:23 — FAANG Question #1 — Amazon: Running Revenue Per Region
15:01 — FAANG Question #2 — Stripe: Cumulative Signups + Daily % with CTE
20:04 — Recap & Next Episode

🎯 KEY TAKEAWAY
Whenever an interview question asks how a metric "grows over time" or "accumulates across rows" — reach for SUM() OVER with a frame specification. Clean, efficient, and exactly what the interviewer expects.

📺 SERIES PLAYLIST
SQL Interview Patterns — FAANG Edition (20 episodes)
Episode 1: Window Functions Basics
Episode 2: Ranking & Top-N Queries
Episode 3: Cumulative & Running Aggregates ← you are here
Episode 4: Gaps & Islands (coming next)

🔧 WHO THIS IS FOR
Senior data engineers, analytics engineers, and software engineers preparing for SQL technical rounds at FAANG and other top-tier companies.

💬 Drop a comment if you've been asked a running-total question in an interview — what company, what variant?

#SQL #DataEngineering #FAANGInterview #WindowFunctions #SQLInterview #DataScience #Amazon #Stripe

Видео FAANG SQL Interview Pattern #3 — Cumulative & Running Aggregates канала Manjinder Brar
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять