24 problems that keep coming up in coding rounds, grouped by the idea that solves them. Write your answer, run the tests right here in the browser, and once you’ve solved it see the complexity interviewers expect and the question they usually ask next.
The tests check that your answer is correct, including the edge cases. They don’t time it: speed on your device says nothing about Big-O, so each problem states the complexity to aim for instead. Free, no account needed; progress is kept in this browser.
You need to find, count or group things fast: trade memory for O(1) lookups.
New to this pattern? Read the lesson →The input is sorted, or you compare the two ends of a sequence.
New to this pattern? Read the lesson →The question says contiguous subarray or substring.
Matching pairs, nearest greater/smaller, or undoing the last thing.
New to this pattern? Read the lesson →Sorted input, or a yes/no condition that flips exactly once.
New to this pattern? Read the lesson →Count the ways, or find the best total, where choices overlap.
New to this pattern? Read the lesson →Character-level scanning; know your str methods cold.
New to this pattern? Read the lesson →Questions that test the language itself: generators, decorators, recursion.
New to this pattern? Read the lesson →Not sure you’re ready for these? Take the 5-minute level test first.