Study plan
Reading about SQL and Python will not get you through a live-coding interview. Solving tasks out loud, on a timer, will. This page turns the site into a plan that fits the time you have: the core first, then the patterns, and full tasks from the first week.
Choose your plan
Section titled “Choose your plan”Pick a timeline and work down the checklist. Each step links to the page to read or the tasks to solve, and each phase starts with what to aim for in that plan. Ticks are saved in your browser and shared with the skill map: a page ticked here shows as learned on the map, and the plan you pick here is the plan the map shows. To move your progress to another device, use Download progress under the map.
The hours of each plan come from the same estimate as the map: reading at about 150 words a minute, a fixed time for each exercise, each task at one and a half times its target time, plus the second attempts and the mock interviews the plan asks for. The flashcards add a few minutes a day.
A step with exercises shows how many of them have passed Check, for example “exercises: 2/3”. When all of them pass, the step offers All solved: mark as learned. In the short plan a step counts only the drills and traps marked “core” on the page and the tasks it names.
0 of 108 exercises solved
Clear the pages marked as learned, the pages opened, the plan ticks and the solved exercises, on the map and in the study plan? The chosen plan and the flashcards stay.
Get oriented
Aim: Know what the interviewer checks and how to split the time of a task.
Aim: Learn the protocol and say its phrases out loud until they come without thinking.
Aim: Learn the protocol and use it on every exercise of this site, not only on the tasks.
- Read what a live-coding interview tests and how this site works
- Pick a plan and read how to practise
- Learn the protocol: restate, ask, plan, code in small steps, check
- Pick two or three phrases for each stage and say them out loud
- Get to know the practice dataset and run a first query
- Prepare two questions for the end of the interview
SQL foundations
Aim: Solve the core drills on each page without looking at the answer, and guess every core trap before running it.
Aim: Solve every drill, then say out loud which trap it protects against.
Aim: Solve every drill twice: today, and from an empty editor a few days later.
- Filters and dates: half-open intervals, months, "today"
- GROUP BY, HAVING and the three kinds of COUNT
- NULL: comparisons, NOT IN, empty sums
- CASE, FILTER and rates without integer division
- JOIN: keys, how tables connect, one row per what
- LEFT JOIN: "every X, even with zero"
- CTE, EXISTS and NOT EXISTS
- PostgreSQL specifics that break queries from other databases
SQL patterns
Aim: Know the five patterns that most tasks are built from, recognise them in a task text, and have one sentence ready about indexes.
Aim: Know every pattern and the follow-up question it usually brings.
Aim: Know every pattern, and solve each drill a second way (a window instead of a subquery, and back).
- Row multiplication: aggregate before you join
- Best and latest per group: ROW_NUMBER, RANK, DISTINCT ON
- Shares, running totals and LAG
- Every day, even empty; active at a moment
- Duplicates, constraints and ON CONFLICT
- UNION ALL and FULL OUTER JOIN: two feeds, two sources
- Money: flows, balances and ledgers
- Indexes and EXPLAIN: which index helps this query
- Database concepts out loud: transactions, isolation, constraints
- Cohorts and retention
Python for live coding
Aim: Have the everyday tools in your fingers: dict, set, sorted, Decimal, datetime, a small class.
Aim: Add decorators, error handling and time windows, and name the complexity of every solution.
Aim: Everything, plus generators and the follow-up questions about testing and production.
- dict, defaultdict and Counter: group and count
- Sets: duplicates and comparing two collections
- Sorting by several keys and top-k
- Money with Decimal: rounding, splitting, allocating
- Dates, months and ISO strings
- Intervals: overlap and merge
- A small class with state and an injected clock
- Complexity and testing: what to say after the code works
- Decorators and closures
- Errors and input validation
- Time windows with deque
- Python and the database: parameters, where the work goes
- Iteration, batches and generators
Interview tasks
Aim: Solve the eight tasks below on a timer, out loud, from an empty editor; the other tasks on these pages are optional. Read the walkthrough only after Check passes. Interviewing for a backend role? The optional steps add a rate limiter and a TTL cache.
Aim: Solve most tasks on a timer. Redo the one that went worst three days later.
Aim: Solve every task twice, and answer the follow-up question after each one.
- SQL: revenue reports
- SQL: subscriptions over time
- SQL: debug a broken report
- SQL: trial conversion, churn and running revenue
- SQL: duplicates, reconciliation, balances and a daily table
- Python: events, periods and dates
- Python: debug two broken modules
- Python: advances, matching, safe payouts, a partner file and writing tests
- Python: a TTL cache, a rate limiter and a paginated API client
- SQL and Python in one task
Before the interview
Aim: Write the recipes on one sheet by hand and do one full mock.
Aim: Recipes by hand, flashcards daily, two mocks with a friend.
Aim: Recipes by hand, flashcards daily, a mock every week.
- Copy the one-line recipes onto a sheet of paper by hand
- Go through the common mistakes the day before
- Review the flashcards (a few minutes a day)
- Read the SQL cheat sheet and find each item in the PostgreSQL docs
- Read the Python cheat sheet and open each module in the Python docs
- Read the glossary and explain each term in one sentence
- Mock interview: a random SQL and a random Python task, on the mock clock, out loud, with a friend or a recorder
The phases are in order, but they overlap in practice. Once you know the protocol and the first SQL pages, start the first tasks and keep reading in parallel. A task that goes badly shows you which page to read next. The last phase, before the interview, is the same in every plan: the recipes by hand, the common mistakes, the flashcards and a mock interview.
Do I need to know everything here?
Section titled “Do I need to know everything here?”No. A live-coding round checks a small and stable core, and most tasks are built from the same few patterns. What you meet beyond the core depends on:
- The role. A data or analytics role leans on SQL: reports, windows, cohorts. A backend role leans on Python, and its SQL part is often simpler: joins, grouping, a duplicate check.
- The level. For senior roles the code matters less than the questions you ask, the checks you run and the follow-up: indexes, duplicates, what happens in production.
- The domain. A payments company likes tasks about money and reconciliation. A consumer product likes conversion, churn and retention.
- The task you get. One or two tasks in an hour is a small sample, so the core must be solid everywhere.
The core that every plan covers: filters with half-open date ranges, GROUP BY and the three kinds of COUNT, NULL, LEFT JOIN with zeros, CTE, the best row per group, row multiplication; in Python, dict and Counter, sorting by several keys, Decimal, dates, intervals and a small class. Everything else adds depth to your follow-up answers.
How to practise
Section titled “How to practise”Set a timer. Give each task 25 minutes, the slot a task gets in a round with two tasks. A task with a target time over 15 minutes gets its target plus 10 minutes. The protocol splits this time by step, and the mock interview uses the same clock. When the timer rings, stop and note where you are. Running out of time is useful information: it shows which step takes too long.
Say it out loud. Restate the task, ask your questions, say the plan, explain each step. It feels strange when you are alone; record yourself, or practise with a friend. The think-aloud phrases give you the words.
Start from an empty editor. Many rounds start from a blank editor. Others give you a function skeleton or a small repository with a bug, but you still write the logic yourself. So practise without the template: type the whole query or function yourself, including the comment block with the answers to your questions.
Press Check before you read the answer. Check tells you whether the result is right, not how to get there. If it fails, find the difference yourself: count the rows, check one row by hand, look for a missing filter. Open Show answer or the walkthrough only after Check passes, or after a real attempt.
Redo a task three days later. Keep a short list of tasks that failed or took too long. Three days later, solve each one again from an empty editor, without looking at your old solution. The second attempt shows whether you learned the pattern or only remembered the answer.
Do a mock interview. At least once before the real one: the mock interview page picks a random SQL task, a random Python task or one of each, starts the timer and hides the hints. Work out loud, with a friend in the interviewer’s role or a recorder running, and end with your questions to ask.
What to skip when time is short
Section titled “What to skip when time is short”With only a few days, keep what most tasks need and leave the rest for later. The short plan above does exactly this:
- Keep: the protocol and the questions to ask, the SQL foundations, five SQL patterns (row multiplication, top N per group, running totals, calendars, duplicates), the Python pages from dicts to testing, and the eight tasks of the short plan on a timer. On each page, the drills and traps marked “core”.
- Skim: indexes and EXPLAIN: the TL;DR, the “In the interview” box and the spoken questions. “Which index would help?” is the most common follow-up to a SQL task.
- Skip: the PostgreSQL dialect, database concepts, reconciliation and ledgers, cohorts and retention (unless you interview for an analytics role), generators, the other tasks on the task pages, and the second way to solve each drill.
- Backend role: a rate limiter and a cache are common backend questions. If you have one more evening, do the optional steps of the short plan: decorators, time windows and the caching and rate limits tasks.
- Never skip: the check before “done”. It takes two minutes and catches the mistakes that cost the most.
Related topics
Section titled “Related topics”- Skill map: the same pages as a map of prerequisites; its progress and the study plan’s ticks are shared.
- Introduction: what the interview tests and how an exercise works.
- Interview protocol: what to do inside each task while you practise.
- Mock interview: the last step of every plan, with a checklist for the review.
- Flashcards: a few minutes a day for the facts behind the patterns.
Site content: CC BY 4.0. Code: MIT. The exercises run in your browser: PostgreSQL by PGlite, Python by Pyodide.