
A Hootshell notebook · for Python coding interviews
Think in Patterns
The Python Coding Interview Notebook
Don’t memorise 340 problems. Learn the 36 patterns behind them.
Coding interviews look endless. Look closer and the same few dozen ideas keep coming back in new clothes. This notebook teaches you to see them, one patient page at a time.
$29₹699Regular price:$39₹999Save 26%Save 30%₹699 in India
Short on time? Route B is 57 problems that cover every classic pattern at least once: at three a day, under three weeks.
A PDF for any screen · 7-day refund · Edition 1.1, November 2026
- 340problems: 300 classic and 40 AI-era
- 36patterns, one chapter each
- 13Foundations topics for beginners
- 913answers, each linked from its exercise and back
- 353Python solution files, run against their tests before release
The problems are free online. Why a book?
A fair question. Here is the plain answer.
- A list gives you questions. This gives you the idea behind them. 340 problems sorted into 36 patterns, each with the words that give it away, so the next problem you have never seen still looks familiar.
- One patient voice, start to finish. Every problem is taught the same way: an everyday scene, the obvious answer, the better one, a drawing, tested Python, why it works, a dry run and the mistakes people make.
- You do part of the work. Questions to predict, dry runs to finish and twists to try, with every one of the 913 answers one link away.
- A route, so you always know what is next. Short on time? Route B is 57 problems that cover every classic pattern at least once: at three a day, under three weeks.
- Checked before it reaches you. Every one of the 353 Python solution files runs against its tests before a release.
And you can check all of it before paying: read 42 pages free, try the free lessons, and if you buy and it is not for you, there is a 7-day refund.
One problem, start to finish
Every problem starts with a scene you already know, like raffle tickets at a school fair. The code comes after.
- An everyday sceneThe problem told as something you already know.
- The obvious answerBrute force first, and what it costs.
- The better oneThe idea that removes the wasted work.
- A drawingThe key moment, drawn by hand.
- PseudocodeThe plan in plain words.
- Tested PythonReadable code that runs against its tests.
- Why it worksThe reason, not only the steps.
- A dry runThe code traced on a small input.
- The mistakes people makeThe traps, before you fall in.
Step 8 for yourself: a dry run
From Contains Duplicate, the raffle-ticket problem: walk the tickets once, keep a set of the numbers seen, and stop at the first repeat.
- 140
- 31
- 92
- 273
- 34
And you do part of the work
Reading a solution feels like understanding it. These three make sure it is.
Predict first
One question to answer before you read on. The next sections tell you if you were right.
Your turn
After the dry run, run the method by hand on a new input. The → answer link takes you there and ↩ brings you back.
A twist to try
The same problem with one rule changed. Adapt the solution yourself, then check its answer.
Every answer is printed at the end of its chapter, never next to its question, so you can’t peek by accident.
You don’t read 2,288 pages. You follow a route.
Nobody reads it cover to cover. Pick a route, and one problem per sitting is plenty.
Each route has its own page in the book. Every step on it is a link, so you always know what to read next and when you are ready to move on.
Route A · Foundations first
Take it if data structures are new to you, or “hash map” and “O(n log n)” still feel vague.
It starts with the 13 Foundations topics: what each structure is, what it costs and where real software uses it. About two weeks at one topic a day.
Route B · Interview core
Take it if you know the basic structures and have an interview coming.
57 problems that unlock the most others, covering every classic pattern at least once. At three a day, under three weeks.
Route C · Applied (AI-era)
Take it if you are aiming at ML, data, backend or AI-agent roles.
The core problems the applied chapters build on, then the six applied chapters: NumPy, pandas, embeddings, APIs, async code and AI agents.
Not sure? Try the first problem without reading its solution. If you can’t write working code in 20 minutes, take route A. If the answer comes to you quickly, take route B.
What you need before page 1: basic Python (variables, if, for and while loops, functions, lists and dicts, running a .py file). No maths beyond school algebra, and no computer-science degree.
Look inside
Nine pages from the book, exactly as printed. Turn them as you would the real thing, and open one larger to read it.


p. 13 · Three ways through the book, and what you need before page 1p. 17 · Route B: the 57-problem Interview core, every step with its page
That was nine pages.
The free sample has 42 of them, to read right here.
All nine pages at once

p. 134 · A problem opens with an everyday scene: raffle tickets at a school fair 
p. 150 · Two Sum: from trying every pair to remembering what you have seen 
p. 137 · Why it works, a dry run, and a Your turn with its answer page 
p. 54 · Foundations: a hash map explained as a wall of lockers 
p. 13 · Three ways through the book, and what you need before page 1 
p. 17 · Route B: the 57-problem Interview core, every step with its page 
p. 232 · The answers for chapter 1, each with a link back to its exercise 
p. 1996 · AI-era: scaled dot-product attention, explained as a meeting 
p. 2250 · Mixed practice: problems in new clothes, with no chapter to give them away
What’s inside
Every one of the 353 solution files runs against its tests before release, on Python 3.14, and is checked on 3.12 too.
The 36 patterns
300 classic interview problems in 30 patterns, then 40 AI-era problems in 6 more. The number is how many problems each chapter has.
Arrays, Strings & Hashing49 problems
- 1Arrays & Hashing19
- 2Prefix Sum & Difference Array8
- 3Cyclic Sort4
- 4Matrix & Grid5
- 5Strings & Pattern Matching13
Two Pointers & Sliding Window27 problems
- 6Two Pointers15
- 7Sliding Window12
Searching & Sorting20 problems
- 8Binary Search15
- 9Sorting & Quickselect5
Linked Lists17 problems
- 10Linked List12
- 11Fast & Slow Pointers5
Stacks & Queues25 problems
- 12Stack13
- 13Monotonic Stack & Queue12
Trees32 problems
- 14Binary Trees (DFS & BFS)21
- 15Binary Search Trees6
- 16Tries5
Heaps14 problems
- 17Top-K, Two Heaps, K-way Merge14
Graphs31 problems
- 18Graph BFS & DFS15
- 19Topological Sort5
- 20Union-Find5
- 21Shortest Paths & MST6
Recursion & Backtracking14 problems
- 22Backtracking14
Dynamic Programming32 problems
- 231-D Dynamic Programming13
- 242-D Dynamic Programming12
- 25Knapsack & Interval DP7
Greedy & Intervals17 problems
- 26Intervals7
- 27Greedy10
Math & Bits15 problems
- 28Bit Manipulation7
- 29Math & Geometry8
Design7 problems
- 30Data-Structure Design7
Applied & AI-era coding40 problems
- 31NumPy & ML Coding8
- 32Pandas & Data Engineering7
- 33Embeddings & Retrieval6
- 34APIs & Backend Patterns6
- 35Async & Concurrency6
- 36AI Agent Patterns7
Around the problems
Everything else that turns 340 problems into a course.
13 Foundations topics
For beginners: What DSA is, and why interviews ask it · Big-O without fear · Memory, variables and references · Arrays and Python lists · Strings · Hash maps · Linked lists · Stacks and queues · Recursion · Sorting and searching · Trees · Heaps and priority queues · Graphs.
The interview toolkit
The six steps to follow out loud in every interview, a cheat sheet from the words in a problem to its pattern, Big-O and Python at a glance, and what to expect in online assessments.
Interviews in the AI era
How AI-assisted rounds work, and what to check in an assistant’s code. Then 40 applied problems: NumPy, pandas, embeddings, APIs, async code and AI agents.
Practice that sticks
A checkpoint after every chapter, 4 mixed practice sets, 4 timed coding rounds and 6 projects.
Plans and a tracker
8-week and 14-day plans, and a tracker with re-solve dates at 3, 10 and 30 days.
Solved it once? Solve it again after 3, 10 and 30 days.
A fully linked PDF
2,288 A4 pages with contents, index, every “see page” reference and bookmarks for every chapter and problem. Plus 36 chapter PDFs, each with its own answers, handy on a phone.
Try 42 pages free
Not sure yet? Read the sample first. No email, no sign-up.
The free sample · 42 pages
The three routes through the book, one Foundations topic (hash maps) and the first problems of chapter 1 with their answers, links and all.
Or download the PDF (1.3 MB) to keep.
Who it’s for
For you if
You know basic Python (loops, functions, lists, dicts) and want to pass coding interviews: students, career changers and working developers. No computer-science degree needed.
What it is not
Not a system-design or behavioural-interview book. Not a promise of a job or an interview result. Not affiliated with LeetCode or any company named in it: LeetCode numbers are there only so you can find each problem to practise on.
Get the notebook
$29₹699Regular price:$39₹999Save 26%Save 30%₹699 in India
Launch price. The regular price, $39₹999, starts after 31 January 2027. One-time purchase, no subscription.
The checkout charges the price for the country you buy from: the rupee price in India, the US-dollar price everywhere else (your checkout may show it converted into your own currency). Tax is included in the price. Checkout by Dodo Payments, the merchant of record; they email your download link right after you pay. All pricing
- The whole book: one fully linked A4 PDF, 2,288 pages
- 36 chapter PDFs, each with its own answers
- Works on any laptop, tablet or phone
- One zip, about 91 MB
- Corrected 1.x editions free
- Your money back within 7 days if it’s not for you
Questions
The problems are free online. Why pay?
A problem list gives you questions. The book gives you the 36 ideas behind them, taught in one voice, with a drawing, tested code, a dry run and an exercise with its answer on every problem, and a route so you know what to do next. The longer answer.
Which Python do I need?
3.12 or newer. The solutions use the standard library, plus NumPy and pandas in two applied chapters.
How do I get the book after paying?
Dodo Payments emails you, usually within a few minutes: a receipt and a link to your download page, where the zip is. That link works for 30 days. After that, or on another device, the customer portal sends you a fresh one: type the email you paid with.
Lost your download?
Open the customer portal and enter the email you bought with: it sends a fresh download link. That page never expires, so it works years later too.
Is tax included?
Yes. The price you see is the price you pay; any tax is inside it.
Can I read it on my phone?
Yes. The whole book is one A4 PDF, and each chapter is also its own PDF with its answers, which is easier on a small screen.
Can I print it?
Yes, for yourself. The licence is on page 5.
Is it on Kindle?
Not yet. For now it is a PDF.
Will it be updated?
Corrections go on the public corrections page, and buyers get corrected editions of 1.x free. What changed in each edition.
Why are company names on some problems?
They come from public interview-question lists and candidates’ reports. They show how widely a problem is reported, not that a company uses it.
What if it isn’t for me?
Email [email protected] within 7 days of buying for a full refund. How refunds work.