DEV Community

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

Posted on • Edited on

4 1 1 2 2

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.

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

Cloudinary image

Optimize, customize, deliver, manage and analyze your images.

Remove background in all your web images at the same time, use outpainting to expand images with matching content, remove objects via open-set object detection and fill, recolor, crop, resize... Discover these and hundreds more ways to manage your web images and videos on a scale.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay