What is a Problem Solving Approach?[Explained in Detail]

 What is a Problem Solving Approach?[Explained in Detail]

What is a Problem Solving Approach?[Explained in Detail]

Today we are going to talk about What is Problem Solving Approach?Why it is useful? Learn the steps in Problem Solving Approach. I was searching around for this topic on google but as it vast  I got confused reading alot of posts. So I thought To write a post on this topic so you get what you are searching for at one place. To find a  solution to a problem we need to define the problem first and then solve it.
Let’s get started,
What is an Algorithm?
A Process or set of steps to accomplish a certain task.

Problem Solving Approach

1. Understand the Problem.
2. Explore Concrete Examples.
3. Break It Down.
4. Solve/Simplify.
5. Look Back and Refactor.

#1] Understand the Problem.

  1. Can I restate the problem in my own words?
  2. What are the inputs that go into the problem?
  3. What are the outputs that should come from the solution to the problem?
  4. Can the outputs be determined from the inputs? In other words, do I have enough information to solve the problem?
  5. How should I label the important pieces of data that are part of the problem?

#2] Explore Concrete Examples

  1. Start with simple examples
  2. Progress to complex examples
  3. Explore Examples with empty inputs
  4. Explore Examples with invalid inputs

#3] Break it Down

Explicitly write down the steps you need to take.
This forces  you to think about the code you’ll write before you write it, and helps you to catch any lingering conceptual issues or misunderstandings before you dive in and have to worry about the details
e.g(language details) as well.

#4] Solve/Simplify

  1. Find the core difficulty in what you’re trying to do.
  2. Temporarily ignore that difficulty.
  3. Write simplified solution.
  4. Then incorporate that difficulty back in. 

#5] Look back & Refactor

  1. Can you check the result?
  2. Can you derive the result differently?
  3. Can you understand it at glance?
  4. Can you improve the performance?
  5. Can you think of other ways to refactor?

We got a look at how to solve a problem using a Approach? But there are some patterns we can use to solve the problems. 

The following are some of them,

  • Frequency Counter
  • Multiple Pointers
  • Sliding Window
  • Divide and Conquer
  • Dynamic Programming
  • Greedy Algorithms
  • Backtracking
In the next post we will take a deep dive in this Problem Solving Patterns with examples in Javascript.
Thank You for reading this post. Hope it helped you.If you like it please share and bookmark my site so that you don’t miss any post.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top