Algorithms · Coding interview prep
Algorithms,visualised.
150 problems, each with a clear explanation, a step-by-step animation and solutions in 6 languages.
- Problems
- 150
- Patterns
- 18
- Languages
- 6
Your progress
Open any problem to begin, and mark it understood when the idea clicks.
Your streak
0Study today to start a streak.
- 2026-09-23: not studied
- 2026-09-24: not studied
- 2026-09-25: not studied
- 2026-09-26: not studied
- 2026-09-27: not studied
- 2026-09-28: not studied
- 2026-09-29: not studied
- 2026-09-30: not studied
- 2026-10-01: not studied
- 2026-10-02: not studied
- 2026-10-03: not studied
- 2026-10-04: not studied
- 2026-10-05: not studied
- 2026-10-06: not studied
Save your progress
Pick up where you left off on any device. No password: sign in with a link we email you, or with Google or GitHub.
or
An account is optional. Without one, your progress is saved in this browser only.
We store your email address and your learning progress — nothing else. No ads, no tracking, never sold. Privacy Policy
18 · Patterns
Patterns
Each pattern is one idea that cracks a family of problems. Learn the idea once; use it everywhere it applies.
- 01Arrays & HashingTrade memory for time: a hash map answers “have I seen this?” in one step instead of a search.9 problems
- 02Two PointersTwo indices walking toward each other (or together) through ordered data, each step ruling out a whole row of possibilities.5 problems
- 03Sliding WindowA stretch of the array that grows at one end and shrinks at the other, so every contiguous stretch is considered without starting over.6 problems
- 04StackLast in, first out: keep the things still waiting to be matched or resolved, and deal with the newest first.7 problems
- 05Binary SearchHalve the possibilities with every question: whenever the answer lies on one side of a line you can test, log n steps find it.7 problems
- 06Linked ListNodes that know only the next one: every trick is about which arrows to redirect, in what order, without losing the rest of the chain.11 problems
- 07TreesA tree is a node and two smaller trees. Solve it for one node, trust the same function on the children, and the whole tree is solved.15 problems
- 08TriesStore words letter by letter down a tree, so every word sharing a beginning shares the path — and a prefix is found in as many steps as it has letters.3 problems
- 09Heap / Priority QueueA heap always knows its smallest (or largest) item, and adding or removing one costs only log n — the tool for “the best k” and “what comes next”.7 problems
- 10BacktrackingBuild an answer one choice at a time; when a choice leads nowhere, undo it and try the next. Every answer is a path through a tree of choices.9 problems
- 11GraphsThings joined to things — cells on a map, courses by their prerequisites, words by one letter. Depth-first goes deep along one path; breadth-first spreads out one ring at a time.13 problems
- 12Advanced GraphsWeighted edges and ordering constraints: shortest paths with Dijkstra and Bellman–Ford, the cheapest network with Prim, and a route that uses every edge once.6 problems
- 131-D Dynamic ProgrammingWhen the answer for n is built from answers for smaller n, compute each one once and keep it. A row of remembered answers, filled in order.12 problems
- 142-D Dynamic ProgrammingTwo things change at once — a position in each of two strings, a row and a column, an index and an amount — so the remembered answers form a table.11 problems
- 15GreedyMake the choice that looks best right now and never revisit it — correct only when you can argue no later step would ever want it undone.8 problems
- 16IntervalsStretches of a line, from a start to an end. Sort them by one end, and overlaps become a question about neighbours.6 problems
- 17Math & GeometryA little arithmetic or a picture of the grid turns a fiddly simulation into a few lines: rotations as flips, powers by squaring, digits by place value.8 problems
- 18Bit ManipulationNumbers are rows of 0s and 1s, and a handful of operations — AND, OR, XOR, shifts — work on every bit at once.7 problems
150 · All problems
All problems
Filter by pattern, difficulty or where you are with it.
- 1Contains DuplicateArrays & HashingEasyNot started
- 2Valid AnagramArrays & HashingEasyNot started
- 3Two SumArrays & HashingEasyNot started
- 4Group AnagramsArrays & HashingMediumNot started
- 5Top K Frequent ElementsArrays & HashingMediumNot started
- 6Product of Array Except SelfArrays & HashingMediumNot started
- 7Valid SudokuArrays & HashingMediumNot started
- 8Encode and Decode StringsArrays & HashingMediumNot started
- 9Longest Consecutive SequenceArrays & HashingMediumNot started
- 10Valid PalindromeTwo PointersEasyNot started
- 11Two Sum II – Input Array Is SortedTwo PointersMediumNot started
- 123SumTwo PointersMediumNot started
- 13Container With Most WaterTwo PointersMediumNot started
- 14Trapping Rain WaterTwo PointersHardNot started
- 15Best Time to Buy and Sell StockSliding WindowEasyNot started
- 16Longest Substring Without Repeating CharactersSliding WindowMediumNot started
- 17Longest Repeating Character ReplacementSliding WindowMediumNot started
- 18Permutation in StringSliding WindowMediumNot started
- 19Minimum Window SubstringSliding WindowHardNot started
- 20Sliding Window MaximumSliding WindowHardNot started
- 21Valid ParenthesesStackEasyNot started
- 22Min StackStackMediumNot started
- 23Evaluate Reverse Polish NotationStackMediumNot started
- 24Generate ParenthesesStackMediumNot started
- 25Daily TemperaturesStackMediumNot started
- 26Car FleetStackMediumNot started
- 27Largest Rectangle in HistogramStackHardNot started
- 28Binary SearchBinary SearchEasyNot started
- 29Search a 2D MatrixBinary SearchMediumNot started
- 30Koko Eating BananasBinary SearchMediumNot started
- 31Find Minimum in Rotated Sorted ArrayBinary SearchMediumNot started
- 32Search in Rotated Sorted ArrayBinary SearchMediumNot started
- 33Time Based Key-Value StoreBinary SearchMediumNot started
- 34Median of Two Sorted ArraysBinary SearchHardNot started
- 35Reverse Linked ListLinked ListEasyNot started
- 36Merge Two Sorted ListsLinked ListEasyNot started
- 37Reorder ListLinked ListMediumNot started
- 38Remove Nth Node From End of ListLinked ListMediumNot started
- 39Copy List with Random PointerLinked ListMediumNot started
- 40Add Two NumbersLinked ListMediumNot started
- 41Linked List CycleLinked ListEasyNot started
- 42Find the Duplicate NumberLinked ListMediumNot started
- 43LRU CacheLinked ListMediumNot started
- 44Merge k Sorted ListsLinked ListHardNot started
- 45Reverse Nodes in k-GroupLinked ListHardNot started
- 46Invert Binary TreeTreesEasyNot started
- 47Maximum Depth of Binary TreeTreesEasyNot started
- 48Diameter of Binary TreeTreesEasyNot started
- 49Balanced Binary TreeTreesEasyNot started
- 50Same TreeTreesEasyNot started
- 51Subtree of Another TreeTreesEasyNot started
- 52Lowest Common Ancestor of a Binary Search TreeTreesMediumNot started
- 53Binary Tree Level Order TraversalTreesMediumNot started
- 54Binary Tree Right Side ViewTreesMediumNot started
- 55Count Good Nodes in Binary TreeTreesMediumNot started
- 56Validate Binary Search TreeTreesMediumNot started
- 57Kth Smallest Element in a BSTTreesMediumNot started
- 58Construct Binary Tree from Preorder and Inorder TraversalTreesMediumNot started
- 59Binary Tree Maximum Path SumTreesHardNot started
- 60Serialize and Deserialize Binary TreeTreesHardNot started
- 61Implement Trie (Prefix Tree)TriesMediumNot started
- 62Design Add and Search Words Data StructureTriesMediumNot started
- 63Word Search IITriesHardNot started
- 64Kth Largest Element in a StreamHeap / Priority QueueEasyNot started
- 65Last Stone WeightHeap / Priority QueueEasyNot started
- 66K Closest Points to OriginHeap / Priority QueueMediumNot started
- 67Kth Largest Element in an ArrayHeap / Priority QueueMediumNot started
- 68Task SchedulerHeap / Priority QueueMediumNot started
- 69Design TwitterHeap / Priority QueueMediumNot started
- 70Find Median from Data StreamHeap / Priority QueueHardNot started
- 71SubsetsBacktrackingMediumNot started
- 72Combination SumBacktrackingMediumNot started
- 73PermutationsBacktrackingMediumNot started
- 74Subsets IIBacktrackingMediumNot started
- 75Combination Sum IIBacktrackingMediumNot started
- 76Word SearchBacktrackingMediumNot started
- 77Palindrome PartitioningBacktrackingMediumNot started
- 78Letter Combinations of a Phone NumberBacktrackingMediumNot started
- 79N-QueensBacktrackingHardNot started
- 80Number of IslandsGraphsMediumNot started
- 81Clone GraphGraphsMediumNot started
- 82Max Area of IslandGraphsMediumNot started
- 83Pacific Atlantic Water FlowGraphsMediumNot started
- 84Surrounded RegionsGraphsMediumNot started
- 85Rotting OrangesGraphsMediumNot started
- 86Walls and GatesGraphsMediumNot started
- 87Course ScheduleGraphsMediumNot started
- 88Course Schedule IIGraphsMediumNot started
- 89Redundant ConnectionGraphsMediumNot started
- 90Number of Connected Components in an Undirected GraphGraphsMediumNot started
- 91Graph Valid TreeGraphsMediumNot started
- 92Word LadderGraphsHardNot started
- 93Reconstruct ItineraryAdvanced GraphsHardNot started
- 94Min Cost to Connect All PointsAdvanced GraphsMediumNot started
- 95Network Delay TimeAdvanced GraphsMediumNot started
- 96Swim in Rising WaterAdvanced GraphsHardNot started
- 97Alien DictionaryAdvanced GraphsHardNot started
- 98Cheapest Flights Within K StopsAdvanced GraphsMediumNot started
- 99Climbing Stairs1-D Dynamic ProgrammingEasyNot started
- 100Min Cost Climbing Stairs1-D Dynamic ProgrammingEasyNot started
- 101House Robber1-D Dynamic ProgrammingMediumNot started
- 102House Robber II1-D Dynamic ProgrammingMediumNot started
- 103Longest Palindromic Substring1-D Dynamic ProgrammingMediumNot started
- 104Palindromic Substrings1-D Dynamic ProgrammingMediumNot started
- 105Decode Ways1-D Dynamic ProgrammingMediumNot started
- 106Coin Change1-D Dynamic ProgrammingMediumNot started
- 107Maximum Product Subarray1-D Dynamic ProgrammingMediumNot started
- 108Word Break1-D Dynamic ProgrammingMediumNot started
- 109Longest Increasing Subsequence1-D Dynamic ProgrammingMediumNot started
- 110Partition Equal Subset Sum1-D Dynamic ProgrammingMediumNot started
- 111Unique Paths2-D Dynamic ProgrammingMediumNot started
- 112Longest Common Subsequence2-D Dynamic ProgrammingMediumNot started
- 113Best Time to Buy and Sell Stock with Cooldown2-D Dynamic ProgrammingMediumNot started
- 114Coin Change II2-D Dynamic ProgrammingMediumNot started
- 115Target Sum2-D Dynamic ProgrammingMediumNot started
- 116Interleaving String2-D Dynamic ProgrammingMediumNot started
- 117Longest Increasing Path in a Matrix2-D Dynamic ProgrammingHardNot started
- 118Distinct Subsequences2-D Dynamic ProgrammingHardNot started
- 119Edit Distance2-D Dynamic ProgrammingMediumNot started
- 120Burst Balloons2-D Dynamic ProgrammingHardNot started
- 121Regular Expression Matching2-D Dynamic ProgrammingHardNot started
- 122Maximum SubarrayGreedyMediumNot started
- 123Jump GameGreedyMediumNot started
- 124Jump Game IIGreedyMediumNot started
- 125Gas StationGreedyMediumNot started
- 126Hand of StraightsGreedyMediumNot started
- 127Merge Triplets to Form Target TripletGreedyMediumNot started
- 128Partition LabelsGreedyMediumNot started
- 129Valid Parenthesis StringGreedyMediumNot started
- 130Insert IntervalIntervalsMediumNot started
- 131Merge IntervalsIntervalsMediumNot started
- 132Non-overlapping IntervalsIntervalsMediumNot started
- 133Meeting RoomsIntervalsEasyNot started
- 134Meeting Rooms IIIntervalsMediumNot started
- 135Minimum Interval to Include Each QueryIntervalsHardNot started
- 136Rotate ImageMath & GeometryMediumNot started
- 137Spiral MatrixMath & GeometryMediumNot started
- 138Set Matrix ZeroesMath & GeometryMediumNot started
- 139Happy NumberMath & GeometryEasyNot started
- 140Plus OneMath & GeometryEasyNot started
- 141Pow(x, n)Math & GeometryMediumNot started
- 142Multiply StringsMath & GeometryMediumNot started
- 143Detect SquaresMath & GeometryMediumNot started
- 144Single NumberBit ManipulationEasyNot started
- 145Number of 1 BitsBit ManipulationEasyNot started
- 146Counting BitsBit ManipulationEasyNot started
- 147Reverse BitsBit ManipulationEasyNot started
- 148Missing NumberBit ManipulationEasyNot started
- 149Sum of Two IntegersBit ManipulationMediumNot started
- 150Reverse IntegerBit ManipulationMediumNot started