What is the most important skill for your career or life? What does your boss value most? Problem solving skills. How to develop problem solving skills? This may take a lesson from programmers. Otherwise, you might be running around like a chicken with its head cut off. Richard Reis summed up how programmers think and gave you steps to think like a programmer.

If you’re interested in programming, you’ve probably seen this phrase before:

Everyone in this country should learn to program a computer because it teaches you how to think.

— Steve jobs

You may be wondering what on earth this means, thinking like a programmer? How do you do that?

Basically it’s all about solving problems more effectively.

The goal of this article is to teach you that way of thinking. .

After reading this article, you’ll know exactly what it takes to become a better problem solver.

Why is this important?

Problem solving is a meta-skill.

We all have problems. No matter big or small. But sometimes the way we solve problems can be a little haphazard.

Unless you have a system, the way you “solve” a problem is something like this (which is how I started coding) :

1. Try a solution.

2. If this solution doesn’t work, try another.

3. If that still doesn’t work, repeat step 2 until you get lucky.

You see, sometimes you get lucky. But that’s the worst way to solve the problem! And very, very time-consuming.

The best way involves a) having a framework, and b) practicing it.

Almost all employers prioritize problem-solving skills.

Problem solving skills are almost certainly the most important qualification employers are looking for… It is more important than programming language ability, debugging ability and system design ability.

Demonstrate that computational thinking or the ability to decompose large and complex problems is just as important (if not more important) as the basic technical skills required for the job

— Hacker Rank, Developer Skills Report 2018

Form a framework

To find the right framework, I followed the advice from Tim Ferriss’s book on learning, The 4 Hour Chef.

This led me to interview two very impressive people: C. Jordan Ball (# 1 and # 2 among Coderbyte’s 65,000 + users) and V. Anton Spraul (author of Think Like a Programmer: An Introduction to Creative Problem Solving).

I asked them the same question, and guess what? Their answers were very similar!

Pretty soon, you’ll know them, too.

Side note: This doesn’t mean they do everything the same. Everyone is different. You will be different, too. But if you start with principles that we all agree are good, you can make big breakthroughs much faster.

The biggest mistake I see new programmers making is focusing on learning syntax instead of learning how to solve problems

– v. Anton Spraul

So, what do you do when faced with a new problem?

Here’s how:

1, understand

Know exactly what is being asked. Most difficult problems are difficult because you don’t understand the problem (hence why this is the first step).

How do you know when you understand a question? When you are able to articulate a problem.

Do you remember when a problem got stuck and you started to explain it and immediately saw a hole in the logic you couldn’t see before?

Most programmers know that feeling.

So that’s why you should write it down, draw a picture, or tell someone (or something… Some people make use of the rubber duck.

If you can’t explain something in simple terms, you don’t really understand it.

– feynman

2, planning,

Don’t jump into problems before you have a plan (and then expect to find a way out like chickens with their heads cut off). Plan your solution first!

If you can’t write down the exact steps, nothing will help you.

In programming, that means never say nothing. Give your brain time to analyze the problem and process the information.

To create a good plan, answer this question:

“What are the necessary steps to return output Y with input X?”

Side note: Programmers have great tools to help them do this… Comment!

3, decomposition

Pay attention to. This is the most important step.

Don’t try to solve a big problem. You’ll cry.

Instead, break the problem down into sub-problems. These sub-problems are much easier to solve.

And then solve these sub-problems one by one. Start with the simplest. Simplest means you know the answer (or are closer to it).

After that, the simplest means that the solved subproblem does not depend on the other solved problems.

Once you have solved each subproblem, connect the dots.

Connecting all of your “sub-solutions” leads to a solution to the original problem. Congratulations to you!

This technique is the cornerstone of problem solving. Memorize it (if not, read this step again).

If THERE was one problem solving skill I could teach novice programmers, it would be “problem solving.”

Let’s say you’re a new programmer and you’re asked to write a program that reads 10 numbers and finds the third largest. This can be a tough assignment for novice programmers, even if it only requires basic syntax.

If you get stuck, you should break the problem down into something simpler. Instead of looking for the third largest number, why not find the largest number first? What about finding the largest number out of three? Or the larger of the two numbers?

Break down the problem to the point where you know how to solve it and write down the solution. Extend the problem a little bit, rewrite the solution to match the problem, and keep doing this until you get back to where you started.

– v. Anton Spraul

4. Stuck?

But you might be thinking, “Hey Richard… That’s cool, but what if I can’t even solve the sub-problem?”

First, take a deep breath. Second, it’s fair.

But don’t worry, my friend. It happens to everyone!

The difference is that the best programmers/problem solvers are more curious about bugs/bugs than they are angry about them.

In fact, here are three things you should try when you get hit:

· Debug: Go through your solution step by step to find out what went wrong. Programmers call this debugging (in fact, all debugging tools do this).

The art of debugging is to figure out what you’re telling the program to do rather than what you think you’re telling it to do

– Andrew Singer

· Reevaluate: Take a step back. Look at the problem from another Angle. Is there anything that can be abstracted into a more general approach?

Sometimes we miss the forest for the trees so much that we lose sight of the general principles of solving problems on a more general level. […]

The classic example of this, of course, is the sum of a series of consecutive integers, 1+2+3+… +n, the problem a young Gauss would quickly realize that the answer was n (n+1) /2, thus avoiding the trouble of having to add up a number.

– c. Jordan Ball

Side note: Another way to reevaluate is to start over. Delete everything and start again with fresh eyes. I’m serious. You’ll be amazed at how effective it is.

· Research: Aha, just Google it. That’s right. Whatever problem you have, someone’s probably already solved it. Find that person/solution. In fact, even if you’ve already solved the problem, look it up! You can learn a lot from other people’s solutions.

Warning: Don’t try to find solutions to big problems. Only look for solutions to subproblems. Why is that? Because unless you put your best foot forward, you don’t learn anything. If you’re not learning anything, you’re wasting your time.

practice

Don’t expect to be great in a week. If you want to be a good problem solver, solve a lot of problems first!

Practice, practice, practice. Along the way you realize that “this problem can easily be solved with [insert concept here].” It’s just a matter of time.

How to practice? There are so many options!

Chess puzzles, math puzzles, Sudoku, Go, real estate tycoon games, video games, Cryptokitties, and more…

In fact, a common pattern among successful people is practicing the habit of “micro problem solving.” For example, Peter Thiel plays chess and Elon Musk plays video games.

“If you want to know what business leadership is going to look like three to five years from now, look at what’s happening with online games,” Byron Reeves said.

Back to the present. Elon, Reid, Zuckerberg, and others have all cited games as the foundation for successful startups.

— Mary Meeker, Internet Trends Report 2017

Does that mean you should play video games? Not at all.

But what are video games for? That’s right, solve the problem!

So, what you should do is to find a suitable place to practice.

For example, I like to be challenged. Every day I try to solve at least one challenge (usually on Coderbyte).

As I said, there is a similar pattern to all problems.

conclusion

That’s it, guys!

Now you should have a better idea of thinking like a programmer.

You also learned that problem solving is an incredible skill to develop (meta skill).

If that’s not enough, notice how to practice your problem-solving skills too!

That’s kind of cool, right?

Finally, I hope you have a lot of problems.

You know what I mean. At least now you know how to fix them! (Plus, you’ll know you’re getting better with every problem you solve.)

Just when you think you’ve successfully removed one obstacle, a new one appears. But that’s what makes life interesting…

Life is the process of breaking through these barriers — life is about breaking through these fortifications.

Each time you learn something.

Each time you develop your strength, wisdom, and perspective.

Every time a competitor leaves you a little behind. Until everyone else looks back at you and sighs: you become the best version of yourself.

Ryan Holiday, The Obstacle Is The Way

Now, go solve some problems!

Good luck!