Skip to main content

Command Palette

Search for a command to run...

How to solve problems like a PRO!

Updated
2 min read
How to solve problems like a PRO!
P
I train people how to program in a fun and easy way based on JavaScript since 2020. Top 7 Technical Writer and author of Clean Code Zero to One. Building AI agents, browser automation, and full-stack applications with JavaScript

🍃Introduction:

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

GIF

Image of puzzle solving

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

You can watch a short animated video regarding this article:

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:

GIF

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!


😎 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.

More from this blog

P

Programming with Shahan

26 posts

I train people how to program in a fun and easy way based on JavaScript since 2020. Top 7 Technical Writer and author of Clean Code Zero to One. Building AI agents, browser automation, and full-stack applications with JavaScript