When we work as developers, our job is actually not to write code. As
counterintuitive as that may sound, our real job is to solve problems. This skill can be incredibly hard to learn, but here is my FAVOURITE method for improving your problem solving skills.

🧵 below 👇
1. Use websites with practice problems. I really like http://edabit.com  and http://leetcode.com , but you can pick any. These allow you solve small problems in isolation, so they're a great way to practice problem solving - and you'll get to see other peoples solutions.
2. When you get to a problem, there's a series of steps I recommend to get the most out of each problem. The first one is to ead the problem description thoroughly. You need to make sure you understand exactly what you are trying to do. Re-read it as much as you need.
3. Nexty, try to solve the problem in the most naive, brute forcing way. Don’t
worry about performance or code readability just yet. Just try your best to solve the problem any way you can. Use pen and paper to help you figure it out. Try to get to a passing state.
4. When you have it working, try to think of a better approach. Can
you make the code easier to understand? Can you make it perform
better? Of course, while making sure your solution still works and that all the tests pass. This helps you to solve the problem in a more ideal way.
5. When you’ve implemented the best solution you can think of,
move on to the next step. This is where you can usually see other
people’s solution to the same problem.
6. If your solution is identical, great - you found the best solution. Usually it won't be. Chances are that someone else's solution is likely better/cleaner/easier than yours. Read through it CAREFULLY to understand exactly what is going on, and why it is better than yours!
7. ONLY when the new solution makes complete sense to you, move to this key final step: GO BACK AND REDO THE PROBLEM! Pretend you are trying to solve
the problem for the first time, but with this newfound knowledge. Don't copy/paste the code, but try to implement it yourself.
8. This final step where you re-implement the best solution is where the real learning happens. Now you've solved the problem your way, but also in a better / more ideal way, and you understand what makes it better than yours. Now apply this method for the next problem ✌
9 (final). Problem solving is a skill that will help you through your entire development career - so make sure you're always practicing it, and try to be pragmatic about it. Follow this method, and your problem solving skills will improve tremendously 🔥
You can follow @madsbrodt.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: