Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Data structures, algorithms and coding interviews

Coding Interview Patterns

Coding interview patterns with examples that run: a method for any problem, then hashing, two pointers, windows, trees, graphs, dynamic programming and more.

219 lessons to read 33 modules

219 lessons: 3 free, 43 free with Pro answers, 27 with a free core and 146 with a free intro.

Examples run with Python 3.14.8 and Pyodide 314.0.7.

Who it is for

Candidates preparing for coding rounds, from internships to mid-level roles, who know one programming language and basic data structures and algorithms.

What you will be able to do

  • Approach any coding problem with a repeatable method, from clarifying questions to tests
  • Read input limits to choose a target complexity, and check it by measuring
  • Recognise the common patterns, such as hashing, two pointers, sliding windows and prefix sums
  • Solve tree, graph, heap, interval and backtracking problems with tested templates
  • Design dynamic-programming states and greedy rules, and argue why they are correct
  • Test a solution with edge cases and with stress tests against a brute force
  • Explain your reasoning aloud and make good use of hints in a live round

Before this track

Revise and practise

Modules and lessons

What the labels mean

Free
the whole lesson and every answer in it
Free lesson, Pro answers
the whole lesson is free; the model answers to its interview questions open with a pass
Free core, Pro depth
the core of the lesson is free; its in-depth parts open with a pass
Free intro, Pro
the first part is free; the rest opens with a pass
Pro
opens with a Pro, Premium or Ultimate pass

Minutes are reading time: “8 of 25 min free” means 8 minutes of the lesson are free.

What a pass opens in this track

227 in-depth parts and 607 interview answers. The same pass opens every other track and every Pro tool.

  1. Module 1

    How to approach a coding round

    A repeatable method for any coding problem: formats, constraints, brute force to optimal, tests, invariants and getting unstuck.

    1. Coding rounds: formats and what gets scored Beginner Free lesson, Pro answers: 20 minutes
    2. A six-step method for any coding problem Beginner Free lesson, Pro answers: 20 minutes
    3. Read constraints to pick the target complexity Beginner Free lesson, Pro answers: 15 minutes
    4. From brute force to optimal: the usual moves Beginner Free lesson, Pro answers: 20 minutes
    5. Edge cases and tests before you code Beginner Free lesson, Pro answers: 20 minutes
    6. Dry runs and loop invariants Beginner Free lesson, Pro answers: 20 minutes
    7. Getting unstuck: heuristics and using hints Intermediate Free lesson, Pro answers: 20 minutes
  2. Module 2

    Interview toolkits in five languages

    The parts of Python, JavaScript/TypeScript, Java, C++ and Go that coding rounds use, the traps in each, and fast input/output for online assessments.

    1. Choosing your interview language Beginner Free lesson, Pro answers: 25 minutes
    2. Python toolkit for coding rounds Beginner Free lesson, Pro answers: 20 minutes
    3. JavaScript and TypeScript toolkit Beginner Free lesson, Pro answers: 20 minutes
    4. Java toolkit for coding rounds Beginner Free lesson, Pro answers: 20 minutes
    5. C++ toolkit for coding rounds Intermediate Free lesson, Pro answers: 15 minutes
    6. Go toolkit for coding rounds Intermediate Free lesson, Pro answers: 25 minutes
    7. Online assessments: input, output and scoring Intermediate Free lesson, Pro answers: 15 minutes
    8. Build a stress tester: brute force vs optimal Intermediate Free lesson, Pro answers: 25 minutes
  3. Module 3

    Arrays and hashing

    Hash maps and sets for lookups, counts and groups, plus in-place tricks that use the array itself.

    1. Hash map patterns: lookup, count, group Beginner Free lesson, Pro answers: 30 minutes
    2. Complement lookup: pairs in one pass Beginner Free core, Pro depth: 8 of 25 minutes free
    3. Frequency maps: checking a valid anagram Beginner Free intro, Pro: 3 of 15 minutes free
    4. Grouping with canonical keys Intermediate Free intro, Pro: 4 of 15 minutes free
    5. Sets for consecutive runs Beginner Free intro, Pro: 3 of 15 minutes free
    6. Product of all others: prefix and suffix passes Beginner Free intro, Pro: 5 of 20 minutes free
    7. Majority vote in O(1) space Intermediate Free intro, Pro: 5 of 20 minutes free
    8. Cyclic placement and in-place marking Intermediate Free intro, Pro: 4 of 25 minutes free
    9. Encoding lists of strings safely Intermediate Free intro, Pro: 4 of 20 minutes free
    10. Knowing what to track in one pass Intermediate Free intro, Pro: 4 of 20 minutes free
  4. Module 4

    Two pointers

    Converging pointers on sorted or symmetric data, reader–writer pointers for in-place edits, and parallel scans of two sequences.

    1. Two pointers: converging and reader–writer Beginner Free lesson, Pro answers: 25 minutes
    2. In-place compaction with reader–writer pointers Beginner Free intro, Pro: 4 of 20 minutes free
    3. Dutch national flag: three-way partitioning Intermediate Free intro, Pro: 4 of 20 minutes free
    4. Merge two sorted arrays in place Intermediate Free intro, Pro: 5 of 20 minutes free
    5. Two pointers on strings: palindromes and edits Intermediate Free intro, Pro: 5 of 25 minutes free
  5. Module 5

    Sliding window

    Fixed and variable windows over arrays, strings and event streams, including monotonic deques and windows that need order statistics.

    1. Sliding windows: fixed and variable Beginner Free lesson, Pro answers: 25 minutes
  6. Module 6

    Prefix sums and difference arrays

    Range totals in O(1), subarray counting with hash maps, remainders and parity, 2-D tables and range updates.

    1. Prefix sums for instant range totals Beginner Free lesson, Pro answers: 25 minutes
    2. Count subarrays with a target sum Intermediate Free core, Pro depth: 7 of 20 minutes free
    3. Divisibility with prefix remainders Intermediate Free intro, Pro: 5 of 20 minutes free
    4. Balanced stretches: ±1 and XOR prefixes Intermediate Free intro, Pro: 5 of 20 minutes free
  7. Module 7

    Sorting as a tool

    What sorting buys, custom orders and comparator traps, linear-time sorts, quickselect, merge-sort counting, medians and ranks.

    1. Sort first: what sorting buys you Beginner Free lesson, Pro answers: 30 minutes
    2. Custom orders and comparator pitfalls Intermediate Free core, Pro depth: 11 of 35 minutes free
    3. Counting, bucket and radix sort Intermediate Free intro, Pro: 6 of 30 minutes free
    4. Quickselect for the k-th element Intermediate Free intro, Pro: 6 of 30 minutes free
    5. Counting pairs with merge sort Advanced Free intro, Pro: 7 of 35 minutes free
    6. Sorting for optimisation: medians and pairing Intermediate Free intro, Pro: 6 of 30 minutes free
    7. Coordinate compression and ranks Beginner Free intro, Pro: 5 of 25 minutes free
  8. Module 8

    Stacks and monotonic stacks

    Nesting, undo and deferred decisions, expression evaluation, next-greater queries, histograms, contribution counting and stack-based greedy choices.

    1. Stack patterns: nesting and undo Beginner Free lesson, Pro answers: 25 minutes
    2. Bracket matching and minimum fixes Beginner Free core, Pro depth: 7 of 25 minutes free
    3. Stacks that know their minimum Beginner Free intro, Pro: 5 of 20 minutes free
    4. Next greater element with a monotonic stack Intermediate Free intro, Pro: 4 of 20 minutes free
    5. Largest rectangle in a histogram Advanced Free intro, Pro: 4 of 20 minutes free
    6. Contribution counting with monotonic stacks Advanced Free intro, Pro: 3 of 15 minutes free
    7. Greedy choices with a monotonic stack Intermediate Free intro, Pro: 4 of 20 minutes free
    8. Stack simulations: collisions and spans Intermediate Free intro, Pro: 3 of 15 minutes free
  9. Module 10

    Linked list patterns

    Dummy heads, in-place reversal, fast and slow pointers, merging, folding, pointer gaps and deep copies.

    1. Linked-list toolkit: dummies and test helpers Beginner Free lesson, Pro answers: 25 minutes
    2. Reversing a linked list in place Intermediate Free core, Pro depth: 11 of 35 minutes free
    3. Fast and slow pointers: middle and cycles Intermediate Free intro, Pro: 8 of 35 minutes free
    4. Merging, splitting and partitioning lists Intermediate Free intro, Pro: 8 of 35 minutes free
    5. Deep copies of lists with extra pointers Intermediate Free intro, Pro: 8 of 30 minutes free
  10. Module 11

    Tree patterns: depth-first

    Recursive contracts, iterative traversals, path problems, lowest common ancestors, BSTs, building and serialising trees.

    1. Recursive tree functions: decide what returns Beginner Free lesson, Pro answers: 35 minutes
    2. Iterative traversals for deep trees Intermediate Free core, Pro depth: 11 of 35 minutes free
    3. Balanced binary tree, height and diameter Intermediate Free intro, Pro: 9 of 35 minutes free
    4. Root-to-leaf paths and backtracking Beginner Free intro, Pro: 8 of 30 minutes free
    5. Maximum path sum through any node Advanced Free intro, Pro: 9 of 35 minutes free
    6. Downward path sums with prefix counts Intermediate Free intro, Pro: 9 of 35 minutes free
    7. Lowest common ancestor Intermediate Free intro, Pro: 6 of 40 minutes free
    8. BST patterns: bounds, order and successors Intermediate Free intro, Pro: 7 of 40 minutes free
    9. Building trees from traversal orders Intermediate Free intro, Pro: 7 of 35 minutes free
    10. Serialise trees to find duplicate subtrees Intermediate Free intro, Pro: 7 of 35 minutes free
    11. Treating a tree as a graph Intermediate Free intro, Pro: 7 of 30 minutes free
  11. Module 12

    Tree patterns: breadth-first

    Level-order templates, side views, vertical order, width and completeness, N-ary trees and parent arrays.

    1. Level-order traversal template Beginner Free lesson, Pro answers: 30 minutes
    2. Side views and zigzag level order Beginner Free core, Pro depth: 10 of 30 minutes free
    3. Vertical order traversal of a binary tree Intermediate Free intro, Pro: 9 of 35 minutes free
    4. Maximum width of a binary tree Intermediate Free intro, Pro: 8 of 35 minutes free
    5. N-ary trees and parent arrays Beginner Free intro, Pro: 8 of 30 minutes free
  12. Module 13

    Heaps and top-K

    Heaps in five languages, top-k, k closest, k-way merge, frontier search, running medians, scheduling and lazy deletion.

    1. Heaps in five languages Beginner Free lesson, Pro answers: 40 minutes
    2. Top-k with a size-k heap Beginner Free core, Pro depth: 10 of 30 minutes free
    3. Top k frequent words: heap or buckets Intermediate Free intro, Pro: 6 of 30 minutes free
    4. K closest points to origin and closest values Intermediate Free intro, Pro: 6 of 30 minutes free
    5. Merging k sorted lists with a heap Intermediate Free intro, Pro: 6 of 35 minutes free
    6. Frontier heaps for k-th smallest pairs Advanced Free intro, Pro: 7 of 35 minutes free
    7. Running median with two heaps Intermediate Free intro, Pro: 6 of 30 minutes free
    8. Scheduling with heaps Intermediate Free intro, Pro: 8 of 35 minutes free
    9. Heaps with lazy deletion Advanced Free intro, Pro: 7 of 35 minutes free
  13. Module 14

    Intervals and sweep line

    Interval conventions, merging, intersections and free time, greedy selection, peak overlap, skylines and online booking.

    1. Interval conventions and overlap tests Beginner Free lesson, Pro answers: 30 minutes
    2. Merge intervals and insert an interval Beginner Free core, Pro depth: 10 of 30 minutes free
    3. Interval list intersections and common slots Intermediate Free intro, Pro: 7 of 30 minutes free
    4. Non-overlapping intervals: the fewest removals Intermediate Free intro, Pro: 7 of 30 minutes free
    5. Minimum number of platforms: peak overlap Intermediate Free intro, Pro: 8 of 30 minutes free
    6. The skyline problem: a sweep line with a heap Advanced Free intro, Pro: 7 of 35 minutes free
    7. My Calendar I: online bookings with ordered maps Advanced Free intro, Pro: 6 of 30 minutes free
  14. Module 15

    Matrices and simulation

    Grid conventions, rotations, spiral and diagonal walks, in-place state encoding and simulations that repeat.

    1. Grid conventions and direction arrays Beginner Free lesson, Pro answers: 30 minutes
    2. Rotate a matrix 90 degrees in place Beginner Free core, Pro depth: 10 of 30 minutes free
    3. Spiral matrix and zigzag diagonal order Beginner Free intro, Pro: 7 of 30 minutes free
    4. Set matrix zeroes: in-place updates with markers Intermediate Free intro, Pro: 9 of 35 minutes free
    5. Simulations that repeat: robot bounded in circle Intermediate Free intro, Pro: 8 of 35 minutes free
  15. Module 16

    Backtracking

    Choose–explore–unchoose, subsets, permutations, combinations, partitions, grid search, constraint puzzles, pruning and meet in the middle.

    1. Backtracking: choose, explore, unchoose Beginner Free lesson, Pro answers: 40 minutes
    2. Generating subsets three ways Beginner Free core, Pro depth: 10 of 30 minutes free
    3. Permutations and next permutation Intermediate Free intro, Pro: 8 of 35 minutes free
    4. Combinations and combination sums Intermediate Free intro, Pro: 8 of 35 minutes free
    5. Partitioning strings with backtracking Intermediate Free intro, Pro: 7 of 35 minutes free
    6. Word search on a grid with backtracking Intermediate Free intro, Pro: 7 of 35 minutes free
    7. Constraint search: N-Queens and Sudoku Advanced Free intro, Pro: 8 of 40 minutes free
    8. Generate parentheses: brackets and expressions Advanced Free intro, Pro: 8 of 35 minutes free
    9. Partition to k equal sum subsets: pruning Advanced Free intro, Pro: 7 of 35 minutes free
    10. Meet in the middle algorithm for n up to 40 Advanced Free intro, Pro: 8 of 35 minutes free
  16. Module 17

    Bit manipulation

    Bits across languages, XOR tricks, counting bits, powers of two, masks and Gray codes, bitwise arithmetic and bitsets.

    1. Bits across languages Beginner Free lesson, Pro answers: 25 minutes
    2. XOR tricks: unique and missing values Beginner Free core, Pro depth: 8 of 25 minutes free
    3. Counting bits: popcount and the 0-to-n table Intermediate Free intro, Pro: 5 of 20 minutes free
    4. Bitwise AND of a range: powers of two, reversal Intermediate Free intro, Pro: 5 of 20 minutes free
    5. Bitmask subsets: submasks and Gray codes Advanced Free intro, Pro: 10 of 35 minutes free
    6. Divide two integers: shifts, carries and 32 bits Advanced Free intro, Pro: 10 of 35 minutes free
    7. Bitsets: subset sums by shifting Advanced Free intro, Pro: 9 of 35 minutes free
  17. Module 18

    Maths for coding rounds

    Integer traps, gcd and lcm, fast power and inverses, primes, combinations, digits and big numbers, check digits, integer geometry and randomness.

    1. Division, remainders and overflow across languages Beginner Free lesson, Pro answers: 30 minutes
    2. Digits, bases and numbers as strings Intermediate Free intro, Pro: 6 of 30 minutes free
    3. Check digits: the Luhn algorithm Beginner Free intro, Pro: 5 of 25 minutes free
    4. Random shuffles and sampling Intermediate Free intro, Pro: 6 of 35 minutes free
  18. Module 19

    Tries

    Prefix trees for lookups, counts and suggestions, wildcard search, grid word search and binary tries for XOR.

    1. Tries: insert, search and prefixes Beginner Free lesson, Pro answers: 40 minutes
    2. Prefix counts and autocomplete suggestions Intermediate Free core, Pro depth: 11 of 35 minutes free
    3. Wildcard search in a trie Intermediate Free intro, Pro: 7 of 35 minutes free
    4. Many words in a grid: trie plus DFS Advanced Free intro, Pro: 8 of 40 minutes free
    5. Binary tries for maximum XOR Advanced Free intro, Pro: 7 of 40 minutes free
  19. Module 20

    Graph patterns: traversal

    Modelling problems as graphs, BFS for shortest paths, grids, multi-source and state-space BFS, DFS, cycles, bipartite checks and Euler paths.

    1. Modelling problems as graphs Beginner Free lesson, Pro answers: 40 minutes
    2. BFS shortest paths: fewest hops and the route Beginner Free core, Pro depth: 12 of 35 minutes free
    3. Number of islands: flood fill and border regions Intermediate Free intro, Pro: 9 of 35 minutes free
    4. Multi-source BFS: nearest source and spreading Intermediate Free intro, Pro: 8 of 30 minutes free
    5. BFS over states: word ladders and padlocks Intermediate Free intro, Pro: 9 of 35 minutes free
    6. BFS with extra state: keys and wall breaks Advanced Free intro, Pro: 9 of 35 minutes free
    7. Clone a graph: DFS for components and copies Beginner Free intro, Pro: 6 of 35 minutes free
    8. Cycle detection: directed and undirected graphs Intermediate Free intro, Pro: 7 of 35 minutes free
    9. Reconstruct an itinerary with Eulerian paths Advanced Free intro, Pro: 7 of 35 minutes free
  20. Module 21

    Topological sort and DAGs

    Kahn's algorithm, DFS ordering, scheduling with prerequisites, smallest and unique orders, alphabets from sorted words and DP on DAGs.

    1. Topological order with Kahn's algorithm Beginner Free lesson, Pro answers: 35 minutes
    2. Topological order with DFS Intermediate Free core, Pro depth: 10 of 30 minutes free
    3. Scheduling with prerequisites Intermediate Free intro, Pro: 9 of 35 minutes free
    4. Smallest and unique topological orders Intermediate Free intro, Pro: 8 of 35 minutes free
    5. Inferring an alphabet from sorted words Advanced Free intro, Pro: 9 of 35 minutes free
    6. Dynamic programming on DAGs Intermediate Free intro, Pro: 9 of 35 minutes free
  21. Module 22

    Union-find (disjoint sets)

    A short union-find template and its uses: connectivity, redundant edges, merging records, weighted constraints and offline threshold queries.

    1. Union-find: the 20-line template Beginner Free lesson, Pro answers: 35 minutes
    2. Connectivity and redundant edges Intermediate Free core, Pro depth: 10 of 30 minutes free
    3. Merging records that share identifiers Intermediate Free intro, Pro: 6 of 30 minutes free
    4. Offline queries sorted by threshold Advanced Free intro, Pro: 8 of 35 minutes free
  22. Module 23

    Weighted graphs: shortest paths and spanning trees

    Dijkstra and its variants, 0-1 BFS, Bellman–Ford, Floyd–Warshall, augmented states, spanning trees, bridges, strongly connected components and A*.

    1. Dijkstra's algorithm with a heap Intermediate Free lesson, Pro answers: 35 minutes
    2. Dijkstra variants: minimax and probabilities Intermediate Free core, Pro depth: 10 of 35 minutes free
    3. 0-1 BFS with a deque Advanced Free intro, Pro: 6 of 30 minutes free
    4. Min cost to connect all points: Kruskal and Prim Intermediate Free intro, Pro: 7 of 35 minutes free
    5. Critical connections: bridges and cut vertices Advanced Free intro, Pro: 8 of 40 minutes free
    6. Strongly connected components: Kosaraju and Tarjan Advanced Free intro, Pro: 8 of 40 minutes free
    7. A* search with admissible heuristics Advanced Free intro, Pro: 8 of 35 minutes free
  23. Module 24

    Dynamic programming: foundations

    From recursion to DP, state design, linear DP, pick-or-skip, counting with modulo, maximum subarray, word segmentation, LIS and space optimisation.

    1. From recursion to dynamic programming Beginner Free lesson, Pro answers: 40 minutes
    2. Designing DP states and transitions Beginner Free core, Pro depth: 11 of 35 minutes free
    3. Linear DP: steps, costs and choices Beginner Free intro, Pro: 8 of 35 minutes free
    4. Pick-or-skip DP with adjacency rules Beginner Free intro, Pro: 7 of 30 minutes free
    5. Counting ways with modulo arithmetic Intermediate Free intro, Pro: 9 of 35 minutes free
    6. Maximum subarray: sum, product and circular Beginner Free intro, Pro: 8 of 35 minutes free
    7. Segmenting strings with a dictionary Intermediate Free intro, Pro: 9 of 35 minutes free
    8. Longest increasing subsequence Intermediate Free intro, Pro: 7 of 35 minutes free
    9. LIS applications: envelopes and chains Advanced Free intro, Pro: 8 of 40 minutes free
    10. Space optimisation and reconstruction Intermediate Free intro, Pro: 8 of 40 minutes free
  24. Module 25

    Dynamic programming: knapsack, grids and strings

    0/1 and unbounded knapsack, subset sums, grid DP, LCS and diffs, edit distance, palindromes, pattern matching and rebuilding answers.

    1. 0/1 knapsack: table to one row Intermediate Free lesson, Pro answers: 35 minutes
    2. Subset sums, partitions and target signs Intermediate Free core, Pro depth: 10 of 30 minutes free
    3. Unbounded knapsack and coin change Intermediate Free intro, Pro: 7 of 30 minutes free
    4. Grid DP: paths, costs and squares Intermediate Free intro, Pro: 7 of 30 minutes free
    5. Longest common subsequence and diffs Intermediate Free intro, Pro: 7 of 35 minutes free
    6. Edit distance with operations Intermediate Free intro, Pro: 6 of 35 minutes free
    7. Palindromic substrings and subsequences Intermediate Free intro, Pro: 7 of 35 minutes free
    8. Wildcard and regex-style matching Advanced Free intro, Pro: 9 of 40 minutes free
    9. Interleavings and distinct subsequences Advanced Free intro, Pro: 9 of 35 minutes free
    10. Rebuilding the answer from a DP table Intermediate Free intro, Pro: 7 of 30 minutes free
  25. Module 26

    Dynamic programming: advanced patterns

    Interval DP, state machines, bitmask and digit DP, trees and rerooting, probability, combinatorial counting, data-structure speed-ups and games.

    1. Interval DP: merging and cutting costs Advanced Free lesson, Pro answers: 35 minutes
    2. State-machine DP: buy, sell, cool down Intermediate Free core, Pro depth: 9 of 30 minutes free
    3. Bitmask DP: assignments and shortest tours Advanced Free intro, Pro: 8 of 35 minutes free
    4. Digit DP: counting numbers up to N Advanced Free intro, Pro: 8 of 35 minutes free
    5. Dynamic programming on trees Advanced Free intro, Pro: 7 of 35 minutes free
    6. Rerooting: answers for every root Advanced Free intro, Pro: 7 of 35 minutes free
    7. Probability DP: will the knight stay on the board? Advanced Free intro, Pro: 7 of 35 minutes free
    8. Two-player games with minimax DP Advanced Free intro, Pro: 6 of 30 minutes free
  26. Module 27

    Greedy algorithms and proofs

    When greedy works, activity selection, reach-based greedy, circular tours, last occurrences, cooldowns, two-pass rules, Huffman-style merging and sorted matching.

    1. When greedy works: proofs and counterexamples Intermediate Free lesson, Pro answers: 40 minutes
    2. Activity selection and interval partitioning Intermediate Free core, Pro depth: 13 of 40 minutes free
    3. Jump game: farthest reach and fewest jumps Intermediate Free intro, Pro: 6 of 30 minutes free
    4. Gas station problem: where the circular tour starts Intermediate Free intro, Pro: 7 of 30 minutes free
    5. Partition labels: cuts at last occurrences Beginner Free intro, Pro: 7 of 25 minutes free
    6. Task scheduling with cooldowns Intermediate Free intro, Pro: 8 of 35 minutes free
    7. Two-pass greedy from both ends Intermediate Free intro, Pro: 8 of 30 minutes free
    8. Least-cost merges with a heap (Huffman) Intermediate Free intro, Pro: 8 of 35 minutes free
  27. Module 28

    String patterns

    Strings in five languages, palindromes, the prefix function, the Z-function, rolling hashes, parsing and run-length encoding, and text layout.

    1. Strings in five languages Beginner Free lesson, Pro answers: 35 minutes
    2. Longest palindromic substring Intermediate Free core, Pro depth: 10 of 30 minutes free
    3. Shortest palindrome with the KMP prefix function Advanced Free intro, Pro: 9 of 35 minutes free
    4. Z-function: matching, prefix counts and periods Advanced Free intro, Pro: 7 of 30 minutes free
    5. String to integer (atoi) and run-length encoding Intermediate Free intro, Pro: 8 of 30 minutes free
    6. Text justification and word wrap Intermediate Free intro, Pro: 8 of 30 minutes free
  28. Module 29

    Design-a-data-structure problems

    Designing classes with required costs: LRU and LFU caches, random access sets, stack and queue adapters, versioned stores, iterators and frequency structures.

    1. Design-a-data-structure problems: a method Beginner Free lesson, Pro answers: 40 minutes
    2. LRU cache in O(1) Intermediate Free core, Pro depth: 11 of 35 minutes free
    3. LFU cache in O(1) with frequency buckets Advanced Free intro, Pro: 8 of 40 minutes free
    4. Insert, delete and getRandom in O(1) Intermediate Free intro, Pro: 8 of 35 minutes free
    5. Stack adapters: browser history, undo, queues Beginner Free intro, Pro: 7 of 35 minutes free
    6. Versioned stores: values at any past time Intermediate Free intro, Pro: 8 of 35 minutes free
    7. Iterator design: flatten, peek, interleave Intermediate Free intro, Pro: 8 of 35 minutes free
    8. Frequency stack and a constant-time counter Advanced Free intro, Pro: 9 of 35 minutes free
  29. Module 30

    Range queries: Fenwick and segment trees

    Choosing a range-query structure, Fenwick trees, counting with ranks, segment trees with lazy propagation, sparse tables and LCA.

    1. Choosing a range-query structure Intermediate Free lesson, Pro answers: 40 minutes
    2. Fenwick trees for prefix sums with updates Advanced Free core, Pro depth: 12 of 35 minutes free
    3. Counting smaller elements with Fenwick trees Advanced Free intro, Pro: 8 of 35 minutes free
    4. Segment trees: point updates, range queries Advanced Free intro, Pro: 8 of 40 minutes free
    5. Lazy propagation for range updates Advanced Free intro, Pro: 9 of 45 minutes free
    6. Sparse tables: range minimum and LCA in O(1) Advanced Free intro, Pro: 10 of 45 minutes free
  30. Module 31

    Concurrency coding problems

    Concurrency tasks that appear in coding rounds: limited parallelism, bounded buffers, ordering and thread-safe structures, verified with race detectors.

    1. Concurrency questions in coding rounds Intermediate Free: 35 minutes
    2. Running tasks with a concurrency limit Intermediate Free core, Pro depth: 10 of 30 minutes free
    3. Bounded buffers and ordered workers Intermediate Free intro, Pro: 8 of 35 minutes free
    4. Thread-safe counters, caches and aggregation Advanced Free intro, Pro: 9 of 40 minutes free
  31. Module 32

    Coding rounds with AI: read, debug, extend

    What public sources say about AI-assisted rounds, and the skills they reward: reading and debugging unfamiliar code, extending it and verifying code you did not write.

    1. Coding rounds with an AI assistant Intermediate Free: 25 minutes
  32. Module 33

    Pattern recognition and mixed practice

    A decision guide, operation costs, a bug catalogue, unlabeled mixed drills and a revision system.

    1. Which pattern? A decision guide Intermediate Free lesson, Pro answers: 20 minutes
    2. Operation costs across five languages Beginner Free core, Pro depth: 7 of 20 minutes free
    3. Mixed drill: arrays, strings and windows Intermediate Free intro, Pro: 6 of 25 minutes free
    4. Mixed drill: DP, greedy and backtracking Advanced Free intro, Pro: 4 of 20 minutes free
    5. Revision: re-solve queues and pattern notes Beginner Free intro, Pro: 5 of 25 minutes free

Related tools

Official documentation

More in Data structures, algorithms and coding interviews

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.