Data Structures
How data is arranged so it can be used efficiently.
6 subjects · 43 topics · 8 areas · 4 cheatsheets
Subjects covering this category
6 subjects- Subject · Beginner to Advanced
Choosing a data structure by the cost of its operations, and implementing arrays, linked lists, stacks, queues, hash tables, trees, heaps, tries and graphs in Python, Java and TypeScript.
- Measuring Cost
- Sequences and Lookup
- Recursion and Trees
- Subject · Intermediate to Advanced
Recognising which of the common problem-solving patterns an unseen coding problem needs, and solving it in Python, Java or TypeScript within the time an interview allows.
- Approach
- Array and Number Patterns
- Linked List Patterns
- Subject · Intermediate to Advanced
Holding data in the right Java collection, and transforming it without writing a loop.
- Collections
- Pipelines
- Subject · Intermediate to Advanced
Tracing, implementing and proving the cost of the classic searching, sorting and graph algorithms, and designing new ones with divide and conquer, backtracking, greedy choice and dynamic programming, in Python, Java and TypeScript.
- Searching and Simple Sorting
- Efficient Sorting
- Design Strategies
- Subject · Beginner to Advanced
Writing Java that compiles, runs, and models a problem with objects.
- The Language
- Objects
- When Things Go Wrong
- Subject · Beginner to Advanced
Turning a product's requirements into a first design for a web system, and knowing what each part is there for.
- Starting a Design
- The Parts of a System
- Moving Data Around
Cheatsheets
4 cheatsheets- Cheatsheet · Data Structures
Every data structure in the subject on one page: what each one is for, what its operations cost, and how to choose.
- Cheatsheet · Java Collections and Streams
Every everyday Java collection on one page: what each one is for, what it costs, and how to choose.
- Cheatsheet · Algorithms
Traversal, ordering, shortest paths, spanning trees and connectivity on one page: which algorithm a graph question needs and what it costs.
- Cheatsheet · Coding Interview Patterns
Fourteen coding interview patterns on one page: the property that points to each, what it costs, when it fails, and its loop in Python.
Graphs
9 topics- Algorithms
Shortest paths in weighted graphs, in algorithms: Dijkstra's algorithm, Bellman-Ford and Floyd-Warshall, and how weights and pairs choose between them.
Intermediate to Advanced11 cards · 6 qnot started
- Algorithms
Breadth-first and depth-first search in algorithms, and what they find: components, cycles, bipartite graphs and unweighted shortest paths.
Intermediate to Advanced10 cards · 6 qnot started
- Algorithms
Minimum spanning trees in algorithms: the cut property, Kruskal's algorithm with union-find, Prim's algorithm with a heap, and why neither gives shortest paths.
Intermediate to Advanced9 cards · 4 qnot started
- Data Structures
Graph representations: storing vertices and edges as an adjacency list or an adjacency matrix, and choosing between them by how many edges there are.
Beginner to Intermediate8 cards · 4 qnot started
- Algorithms
Ordering tasks so every dependency comes first, in algorithms: Kahn's algorithm, depth-first finishing times, and how each one finds a cycle.
Intermediate to Advanced8 cards · 4 qnot started
- Coding Interview Patterns
Grid traversal: treating a grid of cells as a graph for breadth-first and depth-first search, flood fills and searches from many starting cells.
Intermediate to Advanced8 cards · 4 qnot started
- Coding Interview Patterns
Graph modelling: finding the vertices and edges hidden in a problem's wording, then solving it with a search, a topological sort or union-find.
Intermediate to Advanced8 cards · 4 qnot started
- Data Structures
Union-find in data structures: tracking which items share a group with a parent array, merging groups, and counting components and detecting cycles in a graph.
Intermediate to Advanced7 cards · 3 qnot started
- Algorithms
Graph connectivity in algorithms: strongly connected components with Kosaraju's two passes, bridges and articulation points from low values, and choosing the tool.
Intermediate to Advanced7 cards · 3 qnot started
Java Collections
8 topics- Java Collections and Streams
The Java Collections Framework: List, Set and Queue, what each promises, and which type to declare a variable with.
Intermediate to Advanced8 cards · 5 qnot started
- Java Collections and Streams
ArrayList vs LinkedList: two lists with the same methods and opposite costs, how an ArrayList grows, and removing while iterating.
Intermediate to Advanced8 cards · 6 qnot started
- Java Collections and Streams
Sets and queues: collections that decide what counts as a duplicate and what comes out next, and which class to use.
Intermediate to Advanced8 cards · 5 qnot started
- Java Collections and Streams
How a HashMap works: hashing to a bucket, collisions, resizing, the three map classes, and null keys.
Intermediate to Advanced9 cards · 5 qnot started
- Java
Java arrays: a fixed run of values under one name, creating and filling one, zero-based indexes, and why an array cannot grow.
Beginner to Intermediate8 cards · 5 qnot started
- Java
Java equals, hashCode and toString: the defaults every object inherits, the contract between equals and hashCode, and how hash maps lose keys.
Intermediate to Advanced8 cards · 6 qnot started
- Java Collections and Streams
Sorting your own types in Java: Comparable for the natural order, Comparator for the rest, and the two ways a comparator goes wrong.
Intermediate to Advanced9 cards · 5 qnot started
- Java Collections and Streams
Java streams: pipelines over a source, lazy evaluation, map and flatMap, collectors, single use, and when parallel streams pay.
Intermediate to Advanced10 cards · 6 qnot started
Arrays
6 topics- Data Structures
Arrays and strings: why reading by index is instant, why inserting in the middle is not, and how a dynamic array grows without slowing every append.
Beginner to Intermediate9 cards · 4 qnot started
- Java
Java arrays: a fixed run of values under one name, creating and filling one, zero-based indexes, and why an array cannot grow.
Beginner to Intermediate8 cards · 5 qnot started
- Coding Interview Patterns
Prefix sums: precomputing running totals so any range sum is one subtraction, and counting the runs that hit a target with a hash map.
Intermediate to Advanced8 cards · 4 qnot started
- Coding Interview Patterns
Grid traversal: treating a grid of cells as a graph for breadth-first and depth-first search, flood fills and searches from many starting cells.
Intermediate to Advanced8 cards · 4 qnot started
- Java Collections and Streams
ArrayList vs LinkedList: two lists with the same methods and opposite costs, how an ArrayList grows, and removing while iterating.
Intermediate to Advanced8 cards · 6 qnot started
- Java Collections and Streams
Java generics: type parameters, what the compiler checks, type erasure, wildcards, and what erasure forbids.
Intermediate to Advanced9 cards · 5 qnot started
Trees
5 topics- Data Structures
Binary Search Trees: keeping keys in order so that search, insert and delete each follow one path, and why insertion order decides the cost.
Beginner to Advanced9 cards · 6 qnot started
- Data Structures
Heaps: a complete binary tree stored in an array that always gives the smallest or largest item first, the data structure behind every priority queue.
Beginner to Intermediate9 cards · 5 qnot started
- Data Structures
Binary Trees: naming the parts of a tree, traversing it in four orders, counting height in edges, and writing functions that combine two subtrees' answers.
Beginner to Intermediate8 cards · 4 qnot started
- Coding Interview Patterns
Tree patterns: solving binary tree problems by passing values down or returning them up, level by level, or through both subtrees at once.
Intermediate to Advanced8 cards · 4 qnot started
- Data Structures
Tries: a tree with one node per letter, which answers whether any stored word starts with a prefix in time that ignores how many words there are.
Beginner to Intermediate7 cards · 3 qnot started
Linked Lists
4 topics- Data Structures
Linked lists: nodes joined by references, so inserting and deleting is a rewire instead of a shift, at the price of reading by position.
Beginner to Intermediate9 cards · 4 qnot started
- Coding Interview Patterns
Fast and slow pointers: two pointers moving at different speeds that find a list's middle, detect a cycle and locate where the cycle starts.
Intermediate to Advanced8 cards · 4 qnot started
- Coding Interview Patterns
Linked list reversal: reversing a linked list in place with three references, and reversing part of a list or groups of nodes with a dummy node.
Intermediate to Advanced8 cards · 4 qnot started
- Algorithms
Merge sort: the sorting algorithm that splits an array in half, sorts each half and merges them, in O(n log n) time on every input.
Intermediate8 cards · 4 qnot started
Hash Tables
4 topics- Data Structures
Hash tables: the data structure that turns a key into an array index to find values in expected constant time, and what collisions, growth and bad keys do to it.
Beginner to Intermediate10 cards · 6 qnot started
- Java Collections and Streams
How a HashMap works: hashing to a bucket, collisions, resizing, the three map classes, and null keys.
Intermediate to Advanced9 cards · 5 qnot started
- Coding Interview Patterns
Hash map patterns: complements, counts and canonical keys that turn a search inside a loop into one lookup, and the array used as its own hash map.
Intermediate to Advanced8 cards · 4 qnot started
- Java
Java equals, hashCode and toString: the defaults every object inherits, the contract between equals and hashCode, and how hash maps lose keys.
Intermediate to Advanced8 cards · 6 qnot started
Stacks and Queues
3 topics- Data Structures
Stacks and queues: the two data structures defined by the order items leave in, last in first out or first in first out, and how to build each cheaply.
Beginner to Intermediate9 cards · 4 qnot started
- Coding Interview Patterns
Monotonic stack: finding the next greater or smaller element of every position in one pass, with a stack kept in order.
Intermediate to Advanced8 cards · 4 qnot started
- Java Collections and Streams
Sets and queues: collections that decide what counts as a duplicate and what comes out next, and which class to use.
Intermediate to Advanced8 cards · 5 qnot started
Heaps
1 topic- Coding Interview Patterns
Heap patterns: keeping the top K items, merging sorted lists and tracking a running median with one heap or two.
Intermediate to Advanced8 cards · 4 qnot started
In Data Structures itself
9 topics- Data Structures
Big O notation: how to describe the way a data structure operation's cost grows with its input, and why constants and smaller terms drop out.
Beginner to Intermediate8 cards · 5 qnot started
- Data Structures
Analysing complexity: reading the time and space a function needs from its loops, its recursion and the built-in calls hidden inside them.
Beginner to Intermediate8 cards · 5 qnot started
- Data Structures
Recursion: writing a function that calls itself on a smaller input, tracing it through the call stack, and replacing it with a loop when it runs too deep.
Beginner to Intermediate8 cards · 5 qnot started
- Data Structures
Choosing a data structure: listing a program's operations and their frequency, picking the structure that makes them cheap, and the built-ins Python, Java and TypeScript provide.
Intermediate to Advanced7 cards · 4 qnot started
- Data Structures
Combining data structures: an LRU cache from a hash map and a doubly linked list, a set with O(1) random picks from an array and a map, and keeping both parts in step.
Intermediate6 cards · 3 qnot started
- Java
Java methods: declaring and calling them, signatures, parameters and arguments, pass-by-value, and overloading.
Beginner to Intermediate10 cards · 6 qnot started
- Java
Java encapsulation: private fields, the four access levels, references that leak through getters and constructors, and composition against inheritance.
Intermediate to Advanced8 cards · 5 qnot started
- Java
Java variables and types: primitives and references, what assignment copies, the eight primitive types, money, and what the compiler checks.
Beginner to Intermediate9 cards · 5 qnot started
- System Design
Caching: keeping copies of frequent reads close, deciding when they go stale, and the ways a cache can take a system down.
Beginner to Advanced9 cards · 8 qnot started