Pebellslearn by building
RoadmapsMatrixCoursesSandboxSign in

Course details

Leetcode

Most interview problems are a handful of reusable moves in disguise. Learn to read a problem's signals, pick the right move — a hash lookup, two pointers, a sliding window, prefix sums, binary search or backtracking — and write it cleanly in Python.

Ready to learn6 sections · 24 lessons
Start learning

Course curriculum

Thinking in Patterns3 lessons

See what a coding problem is really asking for, read its limits to learn how fast your answer must be, meet the handful of patterns this course teaches and the signals that point to each, and set up Python as your interview language.

  1. What a Practice Problem Really Tests12 min
  2. Patterns: Reusable Moves and Their Signals12 min
  3. Python as Your Interview Language14 min
Arrays & Hashing5 lessons

Replace nested loops with one pass and a set or dictionary: spot repeats, find the partner that completes a pair, compare by counting, group by a shared key, and answer range totals with prefix sums.

  1. The Seen-Set: Spotting Repeats in One Pass12 min
  2. Complement Lookup: Finding a Pair That Adds Up12 min
  3. Counting With Maps: Same Letters, Top Items13 min
  4. Canonical Keys: Grouping Things That Match12 min
  5. Prefix Sums: Range Totals in One Subtraction16 min
Two Pointers4 lessons

Use two indexes that move toward each other to check a string from both ends, find pairs and triples in sorted data, and pick the best pair by always moving the side that limits you.

  1. Converging Pointers: Checking From Both Ends12 min
  2. The Sorted Squeeze: Pairs in a Sorted List12 min
  3. Fix One, Squeeze Two: Triples That Cancel Out15 min
  4. Move the Shorter Side: Greedy Pointer Moves15 min
Binary Search4 lessons

Find a value in a sorted list, search a rotated one, find the exact spot where a yes-or-no answer flips, and binary search the answer itself when a problem asks for the smallest value that works.

  1. Halving the Search: Classic Binary Search12 min
  2. Rotated Lists: Which Half Is Sorted?14 min
  3. Find the Boundary: The Smallest Value in a Rotated List14 min
  4. Binary Search on the Answer16 min
Sliding Window4 lessons

Carry the best value seen so far, slide a fixed-size window without recounting, and grow and shrink a variable window to find the longest stretch that obeys a rule.

  1. Carry the Best So Far: One Buy, One Later Sell12 min
  2. Fixed Windows: Slide, Don't Recount12 min
  3. Grow and Shrink: The Longest Stretch Without Repeats15 min
  4. Keep the Window Valid: Most Common Plus a Budget16 min
Backtracking4 lessons

Use recursion to build every subset, every ordering and every combination that reaches a total, cut dead branches early, and finish by naming the right pattern for a fresh problem before writing any code.

  1. Choose or Skip: Recursion That Builds Subsets15 min
  2. Arrangements: Every Order With a Used List14 min
  3. Prune Early: Combinations That Hit a Total15 min
  4. Capstone: Which Pattern Is This?18 min