window functions
FDE interview questions tagged window functions, across every topic.
7 questions · 6 unlocked for you
Concepts behind "window functions"
The curriculum that explains the ideas these questions test.
Foundational
SQL Window FunctionsWindow functions compute a value across a set of rows related to the current row without collapsing them, so you can rank, compare to a neighbor, or run a cumulative total while keeping every row. They are how analysts answer 'compared to what?' questions in pure SQL, and most interviewers use them to tell people who know SQL from people who know GROUP BY.🗄️ Data & SQL Engineering
Advanced
Gaps and IslandsGaps and islands is the SQL pattern for collapsing a sequence of rows into the contiguous runs (islands) and the breaks between them (gaps). The trick is a difference of two row numbers that stays constant inside a run, giving every row in the same island an identical group key you can then aggregate. It powers sessionization, login streaks, and contiguous date-range queries, and interviewers love it because the naive self-join answer is both slow and wrong on ties.🗄️ Data & SQL Engineering🔒 Premium
