Backend track
SQL for backend interviews
The SQL an interviewer actually probes when the role is backend or full-stack: how joins behave, what makes a query use an index, how to read a plan, where N+1 comes from, and what an isolation level really promises. Written to be read in order.
- 15 lessons
- 97 min of reading
- PostgreSQL throughout
What this track is, and what it is not
This is SQL for people who build services. It covers the query shapes a backend interview asks you to write, and then the things it asks you to reason about: why a query is slow, what the planner decided, what happens when two transactions touch the same row.
It is deliberately not an analytics track. Cohort tables, funnel analysis and retention curves are the staple of a data-analyst loop and they are absent here. Window functions appear only in the forms a backend interview uses — ROW_NUMBER, RANK, LAG and LEAD — rather than as a subject of their own.
Every example is PostgreSQL, and every example runs. If you want to try one, the problems in the bank execute in your browser against a real Postgres, so there is nothing to install.
Open the SQL playground to run any of these examples against a real Postgres, with no sign-in.
Syllabus
Querying and Joins
Aggregation and Subqueries
Indexes and Query Plans
Transactions and Concurrency
Schema Design and Boundaries
Where to go after a lesson
Each lesson ends with the interview questions it prepares you for. The practice bank is where you write the queries: every problem runs against a seeded database in your browser and is graded on the rows it returns, so a correct answer written differently from ours still passes.
If you are deciding whether a relational database is the right choice in the first place, that is a design question rather than a SQL one — SQL vs NoSQL covers it, and the database chapters of the HLD fundamentals go further.