DEV Community

Cover image for Problem solving for developers (4 steps)
Programming with Shahan
Programming with Shahan

Posted on • Updated on

Problem solving for developers (4 steps)

🍃Introduction:

For many new coders, problem-solving can feel like trying to solve a puzzle blindfolded.

Image of puzzle solving

You may know the rules and tools, but how to put them together is the REAL CHALLENGE.

Let's start with the THREE MAJOR STEPS in problem-solving:

🔍1. Know your problem:

Imagine trying to solve a puzzle without knowing what the picture looks like.

Not EASY, right?

Let me make it EASY for you. Your first step in solving a problem is to UNDERSTAND the problem.

Write it down, reword it in SIMPLE English, and draw pictures if needed.

If you can explain it to a friend, you're on the right track.

📝2. Plan:

Don't rush into coding just yet! Plan out HOW you'll solve the problem.

What will your program look like?

What inputs will it take?

What's the EXPECTED output?

Create a recipe (algorithm) in pseudocode, a friendly language that helps you think through the steps.

📔Pseudocode:

Pseudocode is like talking to your computer in PLAIN English. It's a roadmap for your program without the complex code.

For example, instead of saying "if x is greater than y," you'd say, "when the user gives a number, start counting from zero and print each number until you reach their number."

🗡️3. Divide and Conquer:

Image of programmer solving problems like a warrior

Big problems are like GIANT puzzles.

Break them into smaller, solvable pieces.

Focus on the TINY steps first.

Solve one, and it might show you the way to the NEXT.

DO NOT TRY to tackle the whole thing at once – it's like eating a pizza in one bite. Not fun and effective!


You can watch my short animated video regarding this article:

😎 Conclusion:

So, in summary, take it step by step, understand the problem, plan your attack in pseudocode, and conquer the challenges one mini-problem at a time.

Soon, you'll be start solving problems like a PRO!

Thanks for reading this article. Don’t forget to subscribe to my YouTube channel to learn programming effectively.

Comment below with your thoughts. It might help someone.

Top comments (0)