Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. SQL interview questions for data engineers

SQL interview questions for data engineers

Interview-style SQL on the same warehouse tables used across Lakebench. Filter paid orders, fix the grain after a join, write window functions, deduplicate events, and practice the patterns that come up in data engineering screens.

60 SQL problems, 12 of them free. They run in your browser against the same warehouse tables used in Learn. All problems · SQL filter · Theory questions · Learn tracks

What data engineering SQL rounds test

Less trivia, more judgment. Can you tell what one row means before and after a join? Do you reach for a window function instead of a self-join? Do you handle NULLs, duplicates, and late data without being asked? Each problem here is built around one of those habits.

How the problems work

Read the ticket, write a query, and run it against preloaded tables with DuckDB inside your browser. Hidden test cases check the result, and hints walk you toward the pattern if you get stuck. No database to install and no account needed for the free set.

Beginner (15)

  • Filter Engineering salaries
  • Employee salary aggregates
  • Average salary by department
  • Departments with more than three people
  • Top three salaries
  • Distinct departments
  • Employees without a manager
  • Coalesce null salaries to zero
  • Names starting with A
  • Hired in 2023
  • Employee department names
  • Employees with optional department
  • Customers who never ordered
  • UNION vs UNION ALL counts
  • Salary category buckets

Intermediate (30)

  • Conditional category revenue
  • Employee and manager names
  • Duplicate customer-product pairs
  • Keep lowest order_id per duplicate pair
  • Second highest salary
  • Second highest salary per department
  • Running total by customer
  • Salary percent of department total
  • Top three products per category
  • Customers with more than two orders
  • Days employed as of 2026-01-01
  • Month-over-month revenue with LAG
  • Year-over-year revenue growth
  • Consecutive login day pairs
  • Gaps in order_id sequence
  • Deduplicate events with ROW_NUMBER
  • RANK vs DENSE_RANK vs ROW_NUMBER
  • Three-day moving average of transactions
  • Highest and lowest salary per department
  • Department as of 2025-06-01
  • Sessionize events with 30-minute gaps
  • Pivot monthly sales to columns
  • Unpivot wide sales to rows
  • Employee hierarchy under Alice
  • Ordered in every month of Q1 2024
  • Salary percentile within department
  • Time since previous login
  • Cumulative orders per product
  • Top three salaries with ties
  • Customers above average spend

Advanced (15)

  • Longest consecutive login streak
  • Usage by plan with point-in-time contracts
  • Never-ordered customers via NOT EXISTS
  • Near-salary pairs in a department
  • Rows remaining after duplicate cleanup
  • Median employee salary
  • Modal salary
  • Missing dates in early January 2024
  • Yearly resetting running total
  • Customers with month-over-month spend decline
  • First-touch attribution
  • Last-touch attribution
  • Overlapping meetings in a room
  • Peak parallel batch workers
  • Sargable rewrite for order_date filter

Common questions

Which SQL dialect is used?
Queries run on DuckDB, which follows standard SQL closely. Window functions, CTEs, and joins work the way they do in Postgres, Snowflake, BigQuery, and Redshift.
How is this different from LeetCode SQL?
The problems use a connected set of warehouse tables (orders, order items, payments, events) instead of a new toy table each time, so you practice the grain and join mistakes that happen at work.
LakeBenchPractice today. Build tomorrow.

Warehouse practice that runs in the tab, not on a cluster. Learn concepts, solve interview drills, and mock the round in one place.

Product

  • Studio sandbox
  • Capstone projects

Practice

  • SQL interview questions
  • PySpark interview questions
  • Python interview questions
  • DE theory questions
  • LeetCode for data engineers

Company

  • About
  • Contact

Legal

  • Privacy
  • Terms
  • Refunds & cancellation
  • Shipping & delivery

© 2026 Lakebench, operated by Hunnurji Rao. Bengaluru, Karnataka, India.

No cluster. No install. Just the tab.