6 window functions interview questions, asked at Meta, Airbnb, Figma. Last asked Sep 2026.
Time on page from the next user eventCodingGiven a table of user events with timestamps, estimate how long each user stayed on each page as the time until that user's next event. Use LEAD() partitioned by user and ordered…
Last asked Sep 2026
Users with impressions on seven consecutive daysCodingFrom a table of user impressions with dates, find the users who had at least one impression on seven days in a row. Remove duplicate days per user, then use a window function (row…
Last asked Sep 2026
SQL: each user's first share and closest collaboratorCodingTables hold users, files and user actions on files. Write SQL that finds the first time each user shared a file, then a query for each user's closest collaborator, the person they…
Customers who rented in two consecutive weeks (SQL)CodingAmong customers who made purchases in two consecutive full weeks of 2024, return the customer with the most copies rented in the first of those two weeks. Expect to extract the…
Last asked Sep 2025
Top three items per category in SQLCodingFor content in many categories, return the top three items in each category by an engagement measure, handling ties deliberately. Use a ranking window function partitioned by…
Last asked Aug 2025
Question types
Window functions interview questions · Land the Lab