Introduction
A live-coding interview is a short task that you solve on a shared screen while the interviewer watches and asks questions. For data, analytics and backend roles it is usually SQL, Python or both. This site prepares you for that hour: the patterns the tasks are built from, the traps that break them, and a protocol that helps you use the time well.
What the interview tests
Section titled “What the interview tests”Working code is only part of the grade. Interviewers usually watch five things.
- A correct result. The numbers match the question: the right period, the right filters, one row per the right thing. A query that runs but counts test purchases, or loses the last day of the month, is a wrong answer.
- Edge cases. Zeros and empty groups, NULL, duplicates, ties, a period that ends exactly at midnight, a negative amount. A strong candidate raises them before the interviewer does.
- Talking through the work. You say what you are doing and why. Silence of more than 30 seconds is hard to grade; a clear sentence about a wrong idea is easy to correct. The think-aloud phrases give you the words.
- Small steps. You build the answer in pieces and run each piece. A 40-line query written in one go and run once at the end worries an interviewer, even when it works.
- The follow-up. After the code works, a question follows. Which index would help? What is the complexity? What changes with a billion rows? What happens if the same event arrives twice? A short, concrete answer counts as much as the code.
The usual format
Section titled “The usual format”Formats differ between companies, but most fall inside these ranges.
| Typical | |
|---|---|
| Tool | A shared online editor, sometimes a notebook |
| Length | 45–60 minutes |
| Tasks | One or two: SQL, Python, or one of each |
| Time per task | About 25 minutes with two tasks; up to 45 with one |
| AI assistants | Usually not allowed. Where they are, the round checks how you verify the AI’s code |
| Documentation | Usually allowed; ask at the start |
| Data | A small schema you see for the first time |
The SQL is usually PostgreSQL. The Python is usually the standard library, sometimes with pytest. In the first minute, ask one question about the environment: “Can I run code here, and can I use the docs?” Then ask three to five questions about the task. If AI is allowed, the protocol shows how to work with it.
How this site is organised
Section titled “How this site is organised”The site moves from the protocol to the building blocks, then to full tasks. Each section has its own entry in the sidebar.
| Section | What you will learn | Start with |
|---|---|---|
| Start here | The protocol, the phrases, a mock interview, the practice dataset, the plans | Interview protocol |
| SQL foundations | Filters and dates, grouping, NULL, CASE, joins, CTE | Filters and dates |
| SQL patterns | Row multiplication, top N per group, running totals, calendars, duplicates, reconciliation, ledgers, indexes | Row multiplication |
| Python for live coding | dict and Counter, sets, sorting, Decimal, dates, intervals, classes, decorators, time windows | dict and Counter |
| Practice: SQL tasks | 16 interview tasks in five groups | Revenue reports |
| Practice: Python tasks | 13 interview tasks in five groups | Events and time |
| Reference | Recipes, cheat sheets, common mistakes, a glossary, flashcards | Recipes |
The About section holds Contributing and Credits and licence.
Three pages help you plan. The skill map shows every topic with what it needs first. The study plan turns the topics into a checklist for 1 week, 2–3 weeks or 4–6 weeks. The interview protocol is what you do inside each task. When you are ready to test all of it at once, the mock interview gives you a random task with the clock running and the hints hidden.
How a topic page is built
Section titled “How a topic page is built”Topic pages share one layout, so you always know where to look:
- A short opening and a TL;DR box: the recipe lines worth copying onto paper.
- The idea, a short query or function on the practice data, and its real output.
- Traps next to the idea they break.
- Practice: drills with an editor.
- An In the interview box: what to say out loud, and the follow-up that usually comes next.
- Further reading (the PostgreSQL and Python documentation first) and Related topics.
- The topic on the skill map: what to learn first, what it leads to, and a Mark as learned button.
Task pages are different: each task comes with its statement, an editor and a walkthrough that you open after you solve it.
How an exercise works
Section titled “How an exercise works”There are four kinds of exercise.
- Drill. One question, as an interviewer would say it, and an editor. Run executes your code and shows the result. Check compares your result with the reference: for SQL, the rows (and their order, when the order matters); for Python, a set of tests. Show answer opens the reference solution and an explanation.
- Trap. A short query that looks right and is not. Guess the result, run it, then read why. Some traps ask you to fix the query, and Check compares your fix with the correct one.
- Task. A full interview task: the statement, the questions worth asking with their answers, notes about the data, an editor, Check and the reference solution. A walkthrough explains the steps, the traps, the check and the follow-up.
- Playground. A free editor with Run, for your own queries and experiments.
For SQL, Check also runs your query on a hidden dataset of edge cases: a day with no activity, a quiet month for one merchant, sales on the last day of a month, ties, a payout nobody expected, an advance for a merchant who is not enrolled. A query that fits only the visible rows fails there, so a missing calendar or a lost tie shows up at once. Column names do not need to match the reference unless the task asks for them; the values do.
Task texts are in English on both language versions, because that is what you will hear in the interview. Explanations are in the language of the page.
SQL runs on PostgreSQL 18 compiled to WebAssembly (PGlite). Python runs on CPython 3.14 compiled to WebAssembly (Pyodide). Both load into your browser when you first press Run: about 19 MB for PostgreSQL and 13 MB for Python, then cached by the browser. There is no server and nothing to install. Python code can also query the practice database; the dataset page shows how.
The practice dataset
Section titled “The practice dataset”Every SQL exercise runs on one small dataset: a made-up subscription marketplace. Merchants sell subscription products to customers through two partner marketplaces, their own web checkout and free promo access. The marketplaces pay each merchant once a month, after a delay, and an advances program pays merchants early against those payouts. It has seven tables, 12 merchants, 20 products and 8,294 transactions. “Today” is 2026-09-30, always written as a literal. Read the dataset page before the SQL pages: most mistakes in data tasks come from the meaning of a column, not from SQL.
Your progress
Section titled “Your progress”Progress is saved in this browser: the pages you open and mark as learned, the study-plan ticks and the flashcards. There is no account, and nothing is sent anywhere. Another browser or device starts empty. To move your progress, use Download progress under the skill map.
How to use this site
Section titled “How to use this site”-
Pick a study plan for the time you have.
-
Get to know the practice dataset and run your first query.
-
Work through the topic pages. Solve each drill before you open the answer, and guess each trap before you run it.
-
Solve the tasks on a timer: 25 minutes each, or the target time plus 10 minutes for a task with a target over 15 (the protocol explains the clock). Work out loud, from an empty editor, and open the walkthrough only after Check passes.
-
Three days later, solve the task that went worst again, without looking at your old solution.
-
Before the interview, do at least one mock interview and review it with the checklist.
Further reading
Section titled “Further reading”- PostgreSQL documentation: the reference you may open during the interview; learn where things are.
- Python documentation: the standard library reference, in the same role for Python.
- PGlite: PostgreSQL compiled to WebAssembly, which runs the SQL on this site.
- Pyodide: CPython compiled to WebAssembly, which runs the Python on this site.
Related topics
Section titled “Related topics”- Study plan: the next page, a route through the site for the time you have.
- Mock interview: a timed rehearsal of the whole round.
- Interview protocol: what to do in each task, minute by minute.
- Practice dataset: the tables every SQL exercise runs on.
Site content: CC BY 4.0. Code: MIT. The exercises run in your browser: PostgreSQL by PGlite, Python by Pyodide.