How to solve problems in programming (beginners guide)

Shahan Chowdhury
2 min readJan 14, 2024

--

🍃Introduction:

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

GIF

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

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.

--

--

Shahan Chowdhury
Shahan Chowdhury

Written by Shahan Chowdhury

I train people how to program in a fun and easy way ⌐╦╦═─ #JavaScript #Python #Technews ಠ‿↼ alert ("follow for programming news!")