Interview prep
SQL Interview Questions
SQL screens are near-universal for data and backend roles. Joins, window functions and query plans cover most of it.
Questions and answers
01Difference between INNER JOIN and LEFT JOIN?
INNER returns only matched rows; LEFT keeps every row from the left table and fills unmatched right-side columns with NULL. Filtering the right table in WHERE silently turns a LEFT JOIN back into an INNER JOIN.
02What is a window function?
An aggregate evaluated over a defined window of rows without collapsing them — ranking, running totals and period-over-period comparisons.
03How do indexes speed up queries, and when do they hurt?
They give sub-linear lookups on the indexed columns but add write cost and storage. Low-cardinality columns and heavily written tables are where they stop paying off.
04Explain the difference between WHERE and HAVING.
WHERE filters rows before aggregation; HAVING filters groups after aggregation.
05How do you find and fix a slow query?
Read EXPLAIN ANALYZE for the plan, look for sequential scans on large tables and bad row estimates, then add or fix indexes, rewrite correlated subqueries and update statistics.
How to answer these well
Interviewers are not grading recall — they are checking whether you've hit the failure mode the question describes. Anchor every answer to something you actually shipped or debugged with SQL.
Say the trade-off out loud. "I'd use X here, but it costs Y under Z conditions" scores higher than a clean textbook definition every time.
Roles asking for SQL
- Senior Synthetic Data Engineer - Autonomous DrivingNVIDIA · US, CA, Santa ClaraonsiteseniorPosted 13 mins ago
- Product Data EngineerAnduril · Irvine, California, United StatesonsitemidQuick applyPosted 7 hours ago
- Product Data EngineerAnduril · Costa Mesa, California, United StatesonsitemidQuick applyPosted 7 hours ago
- Senior Analytics EngineerRedwood Materials · San Francisco, California, United StatesonsiteseniorQuick applyPosted 8 hours ago
- Data Engineering ManagerRedwood Materials · McCarran, NVonsitemidQuick applyPosted 9 hours ago
- Senior Data EngineerRoku · Austin, TexashybridseniorQuick applyPosted 11 hours ago
- Principal Data Engineer - EconomyRoblox · San Mateo, CA, United StatesonsiteleadQuick applyPosted 12 hours ago
- Senior Growth Data EngineerRoblox · San Mateo, CA, United StatesonsiteseniorQuick applyPosted 12 hours ago
- Senior Data Engineer, EconomyRoblox · San Mateo, CA, United StatesonsiteseniorQuick applyPosted 12 hours ago
- Senior Data Engineer, Vice PresidentState Street · Boston, MassachusettsonsiteleadPosted 1 day ago
Related prep
- Data Engineer jobs
- Data Engineer career guide
- Data Analyst jobs
- Data Analyst career guide
- Backend Engineer jobs
- Backend Engineer career guide
- Data Scientist jobs
- Data Scientist career guide
- Python interview questions
- Java interview questions
- JavaScript interview questions
- React interview questions
- AWS interview questions
- Azure interview questions
- Kubernetes interview questions
- Docker interview questions