166 coding interview problems sorted by the pattern that solves them. Learn the pattern first and most of the problems stop being separate problems. Each link has the statement, a step-through of the solution and answers in Python, C++, Java, JavaScript, Rust and Haskell.
| Problem | Level |
|---|---|
| Pair with a given sum in an unsorted array | Easy |
| Longest run of consecutive integers | Medium |
| The k most frequent values | Medium |
| Count subarrays with a given sum | Medium |
| Product of every element except itself | Medium |
| Smallest positive integer that is missing | Hard |
| Problem | Level |
|---|---|
| Balanced brackets | Easy |
| Days until a warmer day | Medium |
| Largest rectangle in a bar chart | Hard |
| Problem | Level |
|---|---|
| The k-th largest value | Medium |
| Cheapest way to join ropes | Medium |
| Most capital from at most k projects | Hard |
| Problem | Level |
|---|---|
| Sum of every subset’s XOR | Easy |
| Signs that reach a target | Medium |
| Counting n-queens placements | Hard |
| Problem | Level |
|---|---|
| Total time covered by a set of bookings | Easy |
| Fewest meeting rooms for a day of meetings | Medium |
| Fewest bookings to cancel so none overlap | Medium |
| Most profit from jobs that do not overlap | Hard |