Senior engineer interview: reason about data grain
Solve advanced SQL screens on deduplication, latest records, fan-out and safe aggregate design.
Practise each question under time pressure, then explain your assumptions, data grain and edge cases aloud before comparing solutions.
Start interview practice→ 02
→ 03
Your exercises
01For 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.
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.
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.
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.
Return company for accounts that have not churned and had no export event in September 2026, sorted by company alphabetically.