- Guides
- Algorithms
Algorithms
The techniques behind most live coding problems. Explained from intuition, not from formulas.
6 guides3 groups66 min in total
Search and sort
Techniques for finding things fast: swapping a nested loop for a map, sorting first or halving the search space.
About this group0 of 3 readPointer traversals
Ways to walk an array or a string once by moving two indexes carefully. They solve many problems about pairs, subarrays and substrings.
About this group0 of 2 readHelper structures
Simple data structures that keep track of pending work inside an algorithm.
About this group0 of 1 read
About this section
- What these guides are
- Each guide covers one technique that shows up in many interview problems. The goal is for you to recognise when to use it, justify its cost and write it without hesitating. In the interview, that means you reach an efficient solution sooner and explain it better.
- How they are organised
- The techniques are grouped by the kind of work they do: searching and sorting, walking with pointers and leaning on helper structures. Within each group they go from the most basic to the ones that build on earlier ones.
- How each guide works
- Each guide starts with the intuition and the signs that tell you to use the technique, then the steps and its time and memory cost. It includes a step-by-step traced example, code in TypeScript, Python and PHP, variants, common mistakes and frequently asked questions.
- Where to start
- Start with maps and sets for O(1) lookups: it's the improvement most often expected over a first solution. Then go through the rest in order.