CoursesGet hiredCoding interviews

Learn the patterns behind coding interview questions.

For people who can code and want to pass coding interviews. You start with Big O, then work through the patterns one problem at a time, from brute force and two pointers to trees, graphs and dynamic programming.

Start inPythonJavaScriptJavaC++C#TypeScriptGoKotlinScalaSwiftRust

You type every line A real checker runs your code Nothing to install
Lessons
317
Chapters
26
Languages
11
Level
Intermediate
Free lessons
5
Before you start
Loops, functions and lists in one language.

How a problem goes

Think it through

An interactive lesson walks you through the idea before any code.

Build it step by step

You write a line or two at a time, and each step is checked.

Solve it alone

Turn Guided off and write the whole solution against every test.

Syllabus

The Python lessons. The other languages follow the same plan.

01Big O Notation7 lessons
  1. Linear Time Complexity
  2. Constant Time Complexity
  3. Built-in Functions - Time Complexity
  4. Array & String Methods - Time Complexity
  5. Slicing & Concatenation - Time Complexity
  6. Quadratic Time Complexity
  7. Space Complexity
02Brute Force7 lessons
  1. Pair Count
  2. Two Sum
  3. Sorting
  4. Remove Duplicates from Array
  5. Longest Subarray Without Repeating
  6. Minimum Absolute Difference
  7. Find The Difference
03Sorting9 lessons
  1. Sorting
  2. Smallest K
  3. Distinct Values
  4. Remove Duplicates from Array II
  5. Longest Consecutive Sequence
  6. Valid Anagram
  7. Group Anagrams
  8. Find Second Largest
  9. Minimum Absolute Difference II
04Partial Sums #110 lessons
  1. Partial Sums
  2. Maximum Sum Subarrayfree
  3. Maximum Sum Subarray II
  4. Maximum Sum Subarray III
  5. Max Sum of Three Subarrays
  6. Maximum Sum Subarray of Length K
  7. Maximum Sum Subarray of Length K II
  8. Longest Subarray with Sum at most S
  9. Product of Array Except Self
  10. Remove Min Sum
05Partial Sums #29 lessons
  1. Subarray of Given Sum II
  2. Maximum Sum Submatrix II
  3. Maximum Sum Submatrix III
  4. Remove Min Sum II
  5. Max Sum of Three Subarrays II
  6. Max Sum of Three Subarrays III
  7. Max Sum of Three Subarrays IV
  8. Max Sum Square
  9. Count Submatrices with All Ones
06Matrix8 lessons
  1. Transpose Matrix
  2. Toeplitz Matrix
  3. Rotate Image
  4. Spiral Matrix
  5. Spiral Matrix II
  6. Set Matrix Zeroes
  7. Game of Life
  8. Search a 2D Matrix II
07Two Pointers14 lessons
  1. Palindrome Check
  2. Reverse String
  3. Palindrome Substrings
  4. Palindrome Substrings II
  5. Reverse Words II
  6. Two Sum III
  7. Two Sum II - Input Array Is Sorted
  8. Merge Sorted Arrays
  9. Array Diff
  10. Container with Most Water
  11. 3Sum
  12. Rotate Array By One
  13. Rotate Array
  14. Dot Product of Two Sparse Vectors
08Hash Table19 lessons
  1. Hash Map
  2. Collection of Numbers
  3. Ransom Note
  4. Two Sum IV
  5. Hash Set
  6. Distinct Values II
  7. Remove Duplicates from Array III
  8. Find Duplicates
  9. Valid Sudoku
  10. Longest Subarray Without Repeating II
  11. Longest Subarray with at most K Distinct Integers
  12. Longest Consecutive Sequence II
  13. Group Anagrams II
  14. Encode and Decode Strings
  15. Find The Difference II
  16. Intersection of Two Arrays
  17. Top K Frequent Elements
  18. LRU Cache
  19. Design Underground System
09Binary Search15 lessons
  1. Searching
  2. Searching
  3. Searching
  4. Search a 2D Matrix
  5. Two Sum II
  6. Find Peak Element
  7. The Factory
  8. The Factory II
  9. Koko Eating Bananas
  10. Uber Rides
  11. Smallest K V
  12. Search in Rotated Sorted Array
  13. Find Minimum in Rotated Sorted Array
  14. Median of Two Sorted Arrays
  15. Time Based Key-Value Store
10Recursion9 lessons
  1. recursion
  2. Sum of a List, Recursively
  3. Reverse a String, Recursively
  4. Palindrome, Recursively
  5. recursion
  6. Power
  7. Tower of Hanoi
  8. Flatten a Nested List
  9. Decompress File Pathsfree
11Divide And Conquer7 lessons
  1. Searching II
  2. Z Pattern
  3. Merge Sort
  4. Majority Element
  5. Count Inversions
  6. Quick Sort
  7. Smallest K III
12Backtracking15 lessons
  1. Jump Game
  2. Minimum Path Sum
  3. N Queens
  4. Sudoku
  5. Word Search
  6. Letter Combinations of a Phone Number
  7. Generate Parentheses
  8. Generate Binary Strings with K Ones
  9. Subsets
  10. Combination Sum
  11. Subsets II
  12. Combination Sum II
  13. Palindrome Partitioning
  14. Permutations
  15. Generate Valley Permutations
13Memoization8 lessons
  1. recursion
  2. Jump Game II
  3. Jump Game III
  4. Minimum Path Sum II
  5. Minimum Path Sum III
  6. Target Sum
  7. Interleaving String
  8. Longest Increasing Path in a Matrix
14Linked Lists19 lessons
  1. Linked Lists
  2. Sorting
  3. Remove Linked List Elements
  4. Remove Nth Node from End of List
  5. Remove Duplicates from Sorted Linked List
  6. Linked List Cycle
  7. Find the Duplicate Number
  8. Palindrome Linked List
  9. Intersection of Two Linked Lists
  10. Sorting
  11. Flatten Multilevel List
  12. Flatten Multilevel List II
  13. Sorting
  14. Sorting II
  15. Merge Two Sorted Lists
  16. Reorder List
  17. Reverse Nodes in k-Group
  18. Merge K Sorted Lists
  19. Merge K Sorted Lists II
15Sliding Window9 lessons
  1. Sliding Window Technique
  2. Longest Subarray with Sum at most S II
  3. Longest Subarray with at most K Distinct Integers II
  4. Longest Subarray Without Repeating IV
  5. Subarray of Given Sum
  6. Longest Repeating Character Replacement
  7. Permutation in String
  8. Minimum Window Substring
  9. Sliding Window Maximum
16Heap9 lessons
  1. Smallest K II
  2. K Closest Points to Origin
  3. Kth Largest Element in a Stream
  4. Last Stone Weight
  5. Task Scheduler
  6. Maximum Sum Subarray of length K
  7. Maximum Sum Subarray of length K
  8. Find Median from Data Stream
  9. Design Twitter
17Stack13 lessons
  1. Stacks
  2. Valid Parentheses
  3. Evaluate Reverse Polish Notation
  4. Min Stack
  5. Implement Queue using Stacks
  6. Design Browser History
  7. Next Greater Element
  8. Car Fleet
  9. Remove K Digits
  10. Create Maximum Number
  11. Largest Rectangle in Histogram
  12. Reverse Substrings Between Parentheses
  13. Decode String
18Binary Trees27 lessons
  1. Post Order Tree Traversal
  2. ZigZag Tree Traversal
  3. Post Order Tree Traversal
  4. Lowest Common Ancestor in a BST
  5. Post Order Tree Traversal
  6. Binary Tree Maximum Path Sum
  7. Kth Smallest Element in a BST
  8. Validate Binary Search Tree
  9. Count Good Nodes in Binary Tree
  10. Maximum Sum BST in Binary Tree
  11. Maximum Sum BST in Binary Tree II
  12. Post Order Tree Traversal II
  13. Maximum Depth of Binary Tree
  14. Balanced Binary Tree
  15. Invert Binary Tree
  16. Same Tree
  17. Subtree of Another Tree
  18. Recover a Tree from Preorder Traversal
  19. Construct Binary Tree from Preorder and Inorder Traversal
  20. Serialize and Deserialize Binary Tree
  21. ZigZag Tree Traversal II
  22. Inorder Tree Traversal
  23. Level Order Traversal
  24. Binary Tree Right Side View
  25. Flatten Binary Tree
  26. Encoded Tree Sums
  27. Convert Sorted Array to Binary Search Tree
19Tries6 lessons
  1. Longest Common Prefix
  2. Implement Trie (Prefix Tree)
  3. Replace Words
  4. Design Add and Search Words Data Structure
  5. Search Suggestions System
  6. Word Search II
20Dynamic Programming32 lessons
  1. Binary Strings of Given Length
  2. Permutations of Given Length
  3. Valley Permutations of Given Length
  4. Binary Strings Without Consecutive Ones
  5. Binary Strings with K ones
  6. Binary Strings with K Ones on Even Positions
  7. Binary Strings with at most K Consecutive Onesfree
  8. Permutations with K Inversions
  9. Numbers with Digit Product P
  10. Swap Permutations
  11. Best Time to Buy and Sell Stock
  12. Best Time to Buy and Sell Stock II
  13. Trapping Rain Water
  14. Unique Paths
  15. Climbing Stairs
  16. Min Cost Climbing Stairs
  17. House Robber
  18. House Robber II
  19. Decode Ways
  20. Maximum Product Subarray
  21. Best Time to Buy and Sell Stock with Cooldown
  22. Coin Change
  23. Coin Change II
  24. Partition Equal Subset Sum
  25. Word Break
  26. Longest Common Subsequence
  27. Edit Distance
  28. Distinct Subsequences
  29. Regular Expression Matching
  30. Longest Increasing Subsequence
  31. Longest Palindromic Substring
  32. Burst Balloons
21Greedy11 lessons
  1. Lemonade Change
  2. Jump Game: Reach the End
  3. Jump Game V
  4. Best Time to Buy and Sell Stock III
  5. Find Second Largest II
  6. Maximum Units on a Truck
  7. Merge Triplets to Form Target Triplet
  8. Gas Station
  9. Partition Labels
  10. Hand of Straights
  11. Valid Parenthesis String
22Intervals8 lessons
  1. Can Attend All Meetings
  2. Merge Intervals
  3. Insert Interval
  4. Interval List Intersections
  5. Non Overlapping Intervals
  6. Fewest Arrows to Burst Balloons
  7. Meeting Rooms II
  8. Minimum Interval to Include Each Query
23Graphs27 lessons
  1. Depth First Search (DFS): Find if Path Exists in Graph
  2. BFS Min Distance to Every Vertex
  3. Number of Islandsfree
  4. Size of Islands
  5. Number of Connected Components in an Undirected Graph
  6. Graph Valid Tree
  7. Redundant Connection
  8. 01 Matrix
  9. Rotting Oranges
  10. Walls and Gates
  11. Shortest Path with Alternating Colors
  12. Course Schedule
  13. Course Schedule II
  14. Alien Dictionary
  15. Reconstruct Itinerary
  16. Clone Graph
  17. Pacific Atlantic Water Flow
  18. Surrounded Regions
  19. Dijkstra's Algorithm
  20. Cheapest Flights Within K Stops
  21. Swim in Rising Water
  22. Min Cost to Connect All Points
  23. Word Ladder
  24. Word Ladder II
  25. Word Ladder III
  26. Word Ladder IV
  27. Jump Game IV
24Bit Manipulation8 lessons
  1. Find The Difference III
  2. Single Number
  3. Single Number II
  4. Number of 1 Bits
  5. Counting Bits
  6. Missing Number
  7. Reverse Bits
  8. Sum of Two Integers
25Math6 lessons
  1. Plus One
  2. Roman to Integer
  3. Reverse Integer
  4. Happy Number
  5. Multiply Strings
  6. Detect Squares
26Object-Oriented Design - Interviews5 lessons
  1. Parking Lot
  2. Library Checkout
  3. Deck of Cards
  4. Elevator
  5. Rate Limiter

Questions

Something else?
team@algocademy.com

Which language should I use?

The one you’ll interview in. The problems are the same in all 11. If you have no preference, Python is the most popular choice for coding interviews.

Can I practice a real interview?

Yes. In an AI mock interview, an AI interviewer asks and follows up, runs your code against hidden tests and gives you a scorecard. How mock interviews work

More in Get hiredSystem designAI coding practiceAll courses

START HERE

Minimum Value of Three

5 lessons of this path are free. No card needed.