All interview tracks
AdvancedInterview practice · Senior software engineer

Senior engineer interview: reason about data grain

Solve advanced SQL screens on deduplication, latest records, fan-out and safe aggregate design.

5 questions · 44 minutes · Data: Online shop, SaaS company

Practise each question under time pressure, then explain your assumptions, data grain and edge cases aloud before comparing solutions.

Start interview practice
SQL
01
→ 02
→ 03

Your exercises

01
Latest order per customerNew

For customers who have orders, return customer name, order id and order_date of their latest order. Break same-date ties with the larger order id. Sort the final result by customer name alphabetically.

10 min
02
Avoid line-item fan-outNew

Return channel, paid_order_count and paid_revenue for paid orders by channel. Revenue is sum of quantity times charged unit_price, rounded to two decimals. Sort by channel alphabetically.

9 min
03
Find duplicate normalized emailsNew

Return normalized_email (lowercase trimmed email) and customer_count for emails used by more than one customer. Sort by customer_count descending, then normalized_email alphabetically.

8 min
04
Last product event per accountNew

Return company and last_event_date for every SaaS account with at least one product event, sorted by last_event_date newest first, then company alphabetically.

9 min
05
Current customers with no recent exportsNew

Return company for accounts that have not churned and had no export event in September 2026, sorted by company alphabetically.

8 min
Queries run on sample company data in SQLite. Core SELECT, JOIN and GROUP BY patterns transfer to other SQL engines; functions, dates and types can differ.