October 14, 2022
Houston, we have a problem: How to master your problem-solving skills
You’ve probably heard Steve Jobs’ famous quote: “Everyone in this country should learn to program a computer because it teaches you to think.”
This is a very powerful message, but doesn’t necessarily mean you need to become the next Ada Lovelace or Steve Wozniak. Learning programming gives an excellent vocabulary for interacting with the world around you, fosters creativity, improves logic, and prepares you for a very promising career. But the code is not at the center of this message, as most people think (actually if you ask us, zero code is the best code).
Software engineering is ultimately all about problem-solving. Coding is just a tool to solve these problems.
That’s why anyone who wants to become a better software engineer should first become a better problem solver. Translating your solution into the code is the easy part.
In this post, we will cover why this is so important and give you some tips on how to improve your problem-solving skills.
Why problem-solving is important
Most newbies focus on learning a new programming language or framework, then building some applications with that, but once they enter the real world, they will immediately realize that their real job is not only writing code but figuring out a solution and only then writing the right amount of clean, efficient, robust code. Here comes the role of critical thinking…
Critical thinking and problem-solving skills are not only useful in technical interviews, but it can actually help in getting the logic for your program and in writing efficient code for your software. If you have these skills, you will be able to make the right decision in choosing the right solution. And right solutions save company resources, time, and money.
No wonder why giant tech companies’ interviews are focused on problem-solving rather than language/frameworks/tools-specific questions… They want people who can think out of the box, understand the nature of a problem at a deeper level, and find creative solutions.
What if I don’t get logic in programming?
Most new beginners can understand the problems, the logic, and the basics of syntax, they also understand when someone else is explaining the same problem and its solution, but when they try to solve the question on their own, they find themselves staring blankly at their monitor not knowing where to start. They don’t understand how to turn their ideas into code even though they understand the syntax or logic.
So, should you give up in that case?
Of course not. Software is a craft and just like any other craft, it needs practice and patience (a lot of them) to apply and master. It is not something you can learn by watching some tutorials; there are no silver bullets or one-size-fits-all solutions. It takes creativity, experience, and hard work to make your way through a problem and come up with a good solution.
Fortunately, when you practice enough, the response time will be reduced in your brain and you will make the process almost automatic, like you naturally respond to a stimulus.
Just keep in mind that everyone starts from the bottom.
Then, keep going! Rest assured that it is a skill you can master!
How to learn problem-solving
The answer is simple:
Toughen up, loosen up, and practice.
Toughen up by gradually increasing the amount and difficulty of your problem-solving work. Loosen up by deliberately breaking rules and consciously opening yourself to new ideas (including shamelessly appropriating them!). Finally, practice by working on lots and lots and lots of problems. Solving them is not as important. It is very healthy to have several unsolved problems banging around your conscious and unconscious mind (Paul Zeitz, The Art and Craft of Problem Solving).
Problem-solving is a process that involves a series of recurring mental processes. An experienced problem solver confidently tries a number of approaches to get started. This may not solve the problem, but some progress is made. Then more specific techniques come into play. Eventually, at least some of the time, the problem is resolved.
Here are some specific suggestions:
The first step is reading the problem carefully. Pay attention to details such as positive vs. negative, finite vs. infinite, etc. Then begin to classify: is it a “to find” or “to prove” problem? Is the problem similar to others you have seen? Carefully identifying the hypothesis and the conclusion, and trying some quick preliminary brainstorming can be helpful too.
When you finish this (and don’t rush!), go back and do it again. It pays to reread a problem several times.
When looking at the conclusion of the problem, sometimes it helps to “fantasize” an answer. Just make something up, and then reread the problem. Your fantasy answer is most likely false, and rereading the problem with this answer in mind may help you to see why the answer is wrong, which may point out some of the more important constraints of the problem.
When you can explain what the problem asks and what the given is in plain English, you’ll know that you understood the problem. This method of writing out the logic for your program in natural language instead of code is called ‘pseudocode’.
- ‘Startup’ Strategies
At this point, you understand what the problem is asking and you may have some ideas about what to do next. More often than not, this involves one or more of the four basic “startup” strategies: get your hands dirty, penultimate step, wishful thinking and make it easier.
- Get Your Hands Dirty: This is easy and fun to do. Stay loose and experiment. Plug in lots of numbers. Keep playing around until you see a pattern. Then play around some more, and try to figure out why the pattern you see is happening. It is a well-kept secret that much high-level mathematical research is the result of low-tech “plug and chug” methods.
- Penultimate Step: Once you know what the desired conclusion is, ask yourself, “What will yield the conclusion in a single step?” Sometimes a penultimate step is “obvious,” once you start looking for one. And the more experienced you are, the more obvious the steps are.
- Wishful Thinking and Make it Easier: These strategies combine psychology and mathematics to help break initial impasses in your work. Ask yourself, “What is it about the problem that makes it hard?” Then, make the difficulty disappear! Temporarily avoiding the hard part of a problem will allow you to make progress and may shed light on the difficulties. For example, if the problem involves big, ugly numbers, make them small and pretty. At best, pretending that the difficulty isn’t there will lead to a bold solution. At worst, you will be forced to focus on the key difficulty of your problem, and possibly formulate an intermediate question, whose answer will help you with the problem at hand.
- Divide and conquer
When you face a challenge with your code, it can be tempting to dive straight into the solution—but that can be counterproductive. Instead, take some time to break down the problem into sub-problems and then, solve each sub-problem one by one, starting by the smallest and simplest one. Connecting all your “sub-solutions” will give you the solution to the original problem.
There are many benefits to this. The process of reviewing small code changes is simpler and takes less time. You will need minor fixes for the smaller steps. What’s more, you will receive feedback more quickly than you normally would for large changes.
- 5 Whys Method
Imagine you are a detective who wants to solve a mystery. Of course, you can’t solve it without gathering information and questioning witnesses first, right? The same is valid for solving problems. In this case, we don’t have witnesses but rather layers of causes.
The 5 Whys Method is a simple yet effective method that helps you understand why something happened. The goal of this technique is to determine the root cause of a problem by repeating the question “Why?”.
- Ask, “Why did … happen?” five times.
- Each answer forms the basis of the next question.
What you see clearly (the presented problem) is the outer layer. The core cause of a problem is buried beneath a layer of problems. To uncover the root cause of the problem, you must act like a detective and ask “Why?” at each layer. By answering these questions in a stepwise manner, you can uncover the root cause of the problem quickly and efficiently.
- Knowing when to admit defeat
A good problem solver doesn’t give up easily. However, to keep banging your head against a wall is not helpful too. If people never gave up on problems, the world would be a very unpleasant place. Sometimes you just cannot solve a problem. You will have to give up, at least temporarily.
All good problem solvers occasionally admit defeat. An important part of the problem solver’s art is knowing “when” to give up. But most beginners give up too soon because they lack the confidence and concentration. It is hard to work on a problem if you don’t believe that you can solve it, and it is impossible to keep working past your “frustration threshold.”
- Check other people’s code
Googling is part of debugging. You can always look at other people’s code and use some method or piece of code from there adjusting your code to get the solution. In fact, you can learn a lot from other people’s solutions, even after you solved the problem! But in our opinion, it shouldn’t be the first and the last step of the problem-solving process.
When you copy and paste the code without understanding, you won’t learn anything. Our suggestion is to struggle a little bit. Then you can check MDN first, Stack Overflow second. Once you think you have found the right help, don’t copy and paste the code. Type it yourself.
How can Coyotiv help you develop these skills?
Coyotiv’s main difference from other “coding bootcamps” is that we are not a bootcamp, giving you quick fixes. We are a software engineering school that teaches you how to think and solve problems like an engineer.
Our lectures will provide theoretical foundation while daily discussion sessions will help you master your argumentation skills with your peers. With the Coyotiv’s Master-Apprentice model, coupled with pair-programming sessions, students can observe their instructors’ problem-solving techniques and adopt the software engineering mindset in the road to create their own style.
As part of our project-based training, you will learn by working on your software project throughout the course. In the end, the only way to learn a craft is to get your hands dirty.
And that’s the most effective way to learn software engineering.