The most common mistake I see when conducting interviews or watching someone try to solve a programming problem is they try to start writing code as soon as possible.
Another big mistake is trying to over solve the solution on the first iteration. Keep it simple, don’t try to get fancy.
Read the problem completely twice.
This is the single most important step.
You may even want to read the problem 3 or 4 times.
If you don’t understand the problem, you cannot solve it. Do not worry about wasting time here, because the better you understand the problem, the easier it will be to solve it.
“Nothing can be automated that cannot be done manually!”
Programming is automation plain and simple. You may have the ability to skip the manual steps and jump directly to code, but there is a manual process which is the foundation of any code you write.
People often don’t realize how valuable this step is. It is much easier to rearrange and reconstruct and idea or algorithm in your head than it is in code.
Many times you can skip this step if you have a really good handle on the problem or your previous steps
If you are a beginner or struggle with these kinds of problems, I would go ahead and take the time to do this step anyway though.
This step should be extremely easy at this point. If you have done all the other steps, this step involves no problem solving at all.
All we do here is take each comment and convert it into a real line of code.
If you struggle here, there are usually two possible reasons:
You didn’t break down the problem into small enough steps
You don’t know your programming language well enough to do the conversion
Sometimes this step isn’t necessary, but it’s worth taking a look at your code and figuring out if you can cut out a few lines or do something simpler.
What you think is what you become.
If you think your time is worth a few bucks an hour, that you’ll begin to act like it. You’ll find yourself saying “yes” to meaningless, pointless obligations.
But if, in your heart, you know your time is valuable…
Still, many people waste much of their time on pointless, low-quality activities that don’t help them reach their true goals — their mission.
The truth is, most people value their time at far, far less than it’s worth.
They spend hours watching low-quality television and social media when they should be productive and effective.
The difference between successful people and really successful people is that really successful people say no to almost everything.
Value your time at what it deserves to be. The higher the value, the more important and productive work you’ll do — and the less trivial and mindless tasks you’ll get caught in.
“Everyone in this country should learn to program a computer, because it teaches you to think.”
Problem solving is the meta-skill.
We all have problems. Big and small. How we deal with them is sometimes, well…pretty random.
Unless you have a system, this is probably how you “solve” problems:
So, what should you do when you encounter a new problem?
Understand
Plan
Divide
Stuck?
Practice
Don’t expect to be great after just one week. If you want to be a good problem-solver, solve a lot of problems!
You can use 5 Whys for troubleshooting, quality improvement, and problem solving, but it is most effective when used to resolve simple or moderately difficult problems.
The model follows a very simple seven-step process:
Assemble a Team
Define the Problem
Ask the First “Why?”
Ask “Why?” Four More Times
Know When to Stop
Address the Root Cause(s)
Monitor Your Measures