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 Software Engineer, Data Engineering PlatformCoinbase · Remote - USA · RemoteremoteseniorQuick applyPosted 3 hours ago
- Senior Data Engineer, Public SectorScale AI · Washington, DConsiteseniorQuick applyPosted 4 hours ago
- Staff Analytics Engineer, Compliance DataCoinbase · Remote - USA · RemoteremotestaffQuick applyPosted 4 hours ago
- Software Engineer, Data EngineeringRoblox · San Mateo, CA, United StatesonsitemidQuick applyPosted 5 hours ago
- Senior Data EngineerRoku · San Jose, CaliforniahybridseniorQuick applyPosted 5 hours ago
- Senior Data EngineerRoku · Austin, TexashybridseniorQuick applyPosted 5 hours ago
- Security Data EngineerAnduril · Ashville, Ohio, United States; Atlanta, Georgia, United States; Boston, Massachusetts, United States; Costa Mesa, California, United States; Remote; Seattle, Washington, United States; Washington, District of Columbia, United States · RemoteremotemidQuick applyPosted 5 hours ago
- Senior Software Engineer, Data EngineeringRoblox · San Mateo, CA, United StatesonsiteseniorQuick applyPosted 5 hours ago
- Analytics Engineer, Data ScienceDoordash · Austin, TX; Chicago, IL; New York, NY; San Francisco, CA; San Jose, CA; Seattle, WA; Los Angeles, CA; Washington D.C.onsitemidQuick applyPosted 5 hours ago
- Analytics EngineerDoordash · San Francisco, CA; Sunnyvale, CA;Seattle, WAonsitemidQuick applyPosted 5 hours 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