Topic · Quant Development & Systems
← All topicsAlgorithms & Data Structures
72 articles · 8 checkpoints · 46 deeper reads · 18 reference notes
Every article, in reading order
plant a flag as you finish eachRead these first
Bit manipulation uses a number's binary representation directly, AND, OR, XOR, and shifts, to pack data tighter and do certain checks in a single CPU instruction instead of a loop.
A recursive function solves a problem by calling itself on a smaller version of the same problem. The call stack is the bookkeeping that makes it work, and understanding those stacked frames is what turns recursion from magic into a tool you can reason about and cost.
A binary search tree keeps data sorted while still allowing fast inserts and deletes, which arrays and linked lists cannot do at the same time. Everything costs O(height), so the whole subject is really about keeping the tree short.
Dijkstra finds the cheapest route from one node to every other node when edge costs are non-negative. It is BFS with a priority queue instead of a plain queue, and it is what sits underneath any routing decision where hops have different prices.
A greedy algorithm takes the best-looking option at every step and never reconsiders. Writing one is easy; the hard part is proving it is optimal, and the exchange argument is the standard tool for that.
A segment tree answers "what is the sum, min or max over positions i to j?" in O(log n) while still letting you change individual values in O(log n). It is the standard answer when prefix sums break because the data keeps updating.
Merge sort, quicksort, heapsort and insertion sort all put things in order, but they differ in worst case, memory, stability and cache behaviour. Knowing which trade-off you are buying is the interview question, and it decides real things like how a book of orders is ranked.
Union-find answers "are these two things in the same group?" and "merge these two groups" in effectively constant time. It is the right structure whenever connections arrive one at a time and you need to track what has become connected to what.
Then the rest