Leetcode problems and questions - the best 50
Updated: Mar 27
Whether web2 or web3, doing well on data structure, algorithm, and leetcode questions is important, not only for getting a job but developing a good foundation in computer science.
What Leetcode problems should you begin with and in what order should you go?
Getting over the psychological barrier of starting
Nothing is more demoralizing than opening up on of these websites, picking a random problem marked as easy, and then getting stuck. Now you have to expend three times the energy: finding the right problem, solving it, and not psyching yourself out wondering if you picked the wrong problem or are just not cut out for the test.
What we recommend doing is starting out with the leetcode questions and leetcode problems that are hilariously easy to do. No really, how’s this for a challenge?
Not too scary right?
Focusing on the core of the language
There are a lot of data structures and algorithms out there. There are trees, linked lists, heaps, queues, graphs, directed graphs, you name it! To avoid getting overwhelmed with choice, it’s best to focus on the data structures that are built into nearly all modern languages.
nested arrays (2d arrays)
Most languages allow you to use these data structures without importing anything.
To use things like a Queue or a Heap, you have to import a library of some kind. As shiny and “new” as tech is, programming languages have been around for decades. They’ve evolved to make common actions easy. If a language requires more work to use, it will eventually fall out of favor all else being equal.
Mirroring a binary tree is not a common thing. But manipulating strings and arrays is very common, thus they are built into the language.
The list of problems we’ve compiled is designed to make sure you are comfortable with the essentials of the language. These problems will give you an excellent foundation to work off of for more advanced topics later.
Focus on logic and problem-solving first
The names of algorithms can be scary, usually they are the concatenation of rarely used European names with esoteric applications. Floyd-Warshall? Dijkstra’s algorithm? Fisher-Yates?
You can wait to learn those later.
But you absolutely must be able to do basic things that aren’t even “alogorithm-y.”
For example, given a tic-tac-toe grid, can you tell if the game is over? You don’t need any fancy algorithms to accomplish this. If you struggle with this basic task, you will have a hard time with the more advanced algorithms listed above.
The problems we’ve listed here don’t need any special techniques to solve. Learn to apply basic logic and common sense solutions before you add more to your plate of more college-level kind of techniques.
Aren’t these too easy?
Maybe you aren’t the target audience for this, but you’d be surprised at the number of people who call themselves developers but can’t do fizz buzz. We’ve seen this first hand. When you apply to our program, you will promptly receive an email with a link to a coding test. One of them is fizz buzz. And the failure rate on that is high.
Maybe it’s nerves and not taking a coding test before. But if you’ve never practiced a coding test at least once, you are not doing yourself any favors.
Is this enough to pass coding interviews?
You might be able to get a job if you can solve all these problems! It would be a very entry level one at a company that isn't very selective. But it's possible nonetheless.
Don't you have to pay to use these problems?
We've only included problems from the free version.
Due to plagiarism issues we’ve had with other software training programs, this work in its entirety is licensed under the Creative Commons NonCommercial License.
10) https://leetcode.com/problems/to-lower-case/ (just do the opposite)
11) https://leetcode.com/problems/reverse-string/ (don't use two-pointers)
13) https://leetcode.com/problems/count-vowel-substrings-of-a-string/ (don't use hashmap)
22) https://Leetleetcode.com/problems/sort-an-array/ (ignore leetcode instructions, use built-in feature)
2D Array (Playlist):
Hash Table (Playlist):