Coding interview patterns, visualized
Most interview problems are one of a dozen patterns in disguise. Each topic shows the pattern on an example, lists the signals that a problem needs it, and has interview questions to practise on.
Topics marked "Code" have a coding challenge that runs your solution against test cases.
Start with Two Pointers Technique 18 topics
Arrays and strings
- Two Pointers TechniqueMaster the Two Pointers technique! Visualize how moving start and end pointers can check whether a string is a palindrome in linear time — one of the most common patterns for array and string problems, and a must-know for FAANG interviews.BeginnerCode20m
- Sliding WindowVisualize the fixed-size Sliding Window technique for maximum-sum subarray problems. See how reusing the previous window sum avoids redundant calculation, reducing the O(n·k) nested-loop approach to a single O(n) pass.IntermediateCode25m
- Prefix SumLearn the Prefix Sum technique to answer range sum queries in O(1) time. Visualize how pre-computation transforms the array.BeginnerCode15m
- Kadane's AlgorithmFind the maximum sum contiguous subarray in O(n) time. The quintessential dynamic programming problem that every FAANG interview expects you to know.Intermediate15m
Stacks, queues and hashing
- Hash Map: Collision HandlingVisualize how internal Hash Tables work! See how keys are hashed to indices and how collisions are resolved using Chaining (Linked Lists).IntermediateCode20m
- Monotonic StackSolve "Next Greater Element" and "Daily Temperatures" problems efficiently! Visualize how maintaining a sorted stack helps find nearest larger/smaller elements in O(n).IntermediateCode25m
- Monotonic Queue (Sliding Window Maximum)Deque-based technique to track max/min in a sliding window in O(n). Essential for Sliding Window Maximum and optimization problems.Advanced25m
- LRU Cache DesignA classic design problem combining HashMap for O(1) lookup with Doubly Linked List for O(1) ordering. Foundation for caching systems and system design interviews.IntermediateCode25m
Searching
- Binary SearchUnderstand the power of O(log n). Visualize dividing the search space in half to find targets in sorted arrays instantly.BeginnerCode15m
- Advanced Binary Search PatternsVisualize Binary Search on Answer Space through the Koko Eating Bananas (minimize-maximum) pattern. Watch how a feasibility predicate monotonically flips as the candidate answer grows, allowing binary search to locate the optimal value. The Learn tab covers maximize-minimum, rotated arrays, and other advanced variants.AdvancedCode30m
Intervals and greedy
- Interval SchedulingMaster the Merge Intervals pattern: sort by start time, then sweep once to merge every overlapping range into the minimal covering set. Shows up constantly in FAANG interviews as "Merge Intervals," "Meeting Rooms," and "Insert Interval."IntermediateCode20m
- Greedy AlgorithmsSolve scheduling and optimization problems by always making the locally optimal choice. Learn the Activity Selection Problem — the canonical greedy success — and the exchange argument that proves it optimal.IntermediateCode20m
- Sweep Line AlgorithmProcess interval events sorted by position. Essential for meeting rooms, skyline problems, and rectangle area calculations. Often combined with TreeMap or sorted list.Advanced30m
Trees, graphs and recursion
- Trie (Prefix Tree)Optimize prefix-based searches! Visualize how words are stored as a tree of characters. Key for autocomplete and spell checkers.IntermediateCode20m
- Union-Find (Disjoint Set)Master the Union-Find data structure. Essential for Kruskal's Algorithm, connected components, and cycle detection in undirected graphs.IntermediateCode20m
- Topological SortOrder tasks with dependencies! Visualize Kahn's Algorithm using In-Degrees. Crucial for build systems, course scheduling, and resolving dependencies.IntermediateCode25m
- Backtracking (N-Queens)Solve complex problems by building candidates step-by-step and abandoning them ("backtracking") as soon as they fail constraints.AdvancedCode30m
- Bit ManipulationBit manipulation involves working directly with the binary representation of data. Master AND, OR, and XOR operations—three fundamental bitwise operations used in competitive programming, systems optimization, and low-level algorithms. Learn to solve problems like finding unique elements in linear time, testing powers of two, and implementing efficient bitmasks for sets. Essential knowledge for interview questions and real-world performance-critical code.IntermediateCode15m