Sorting
Sort the data, or a key built from each item, so related items end up side by side or in a known order. Look for grouping, ranking or comparing frequencies, as in Group Anagrams. Once sorted, many problems need only a simple scan.
15 problems · 6 with a video · 3 to practice in an AI round
| # | Problem | Difficulty | Video | AI round |
|---|---|---|---|---|
| 1 | Group Anagrams | Medium | AI round | |
| 2 | Valid Anagram | Easy | ||
| 3 | Contains Duplicate | Easy | AI round | |
| 4 | Majority Element II | Medium | — | |
| 5 | Find All Duplicates in an Array | Medium | ||
| 6 | How Many Numbers Are Smaller Than the Current Number | Very easy | ||
| 7 | Determine if Two Strings Are Close | Medium | — | |
| 8 | Sort Array by Increasing Frequency | Very easy | — | |
| 9 | Third Maximum Number | Easy | — | |
| 10 | Maximum Gap | Medium | — | AI round |
| 11 | Minimum Absolute Difference | Easy | — | |
| 12 | Rank Transform of an Array | Very easy | — | |
| 13 | Sorting the Sentence | Very easy | ||
| 14 | Can Make Arithmetic Progression From Sequence | Easy | — | |
| 15 | Rank Teams by Votes | Medium | — |
Sort by what interviews ask
Sign in to see how many companies ask each problem, sort all 500 by it or by likes, and tick off what you solve.
Practice in an AI round
Three of these are AI rounds: 30 minutes, an AI agent beside your code, then a scored report.
Practice Group Anagrams in an AI roundYour first AI round is free.