DEV Community

Code_Regina
Code_Regina

Posted on

Problem Solving Approach

                   -Intro to Problem Solving
-Understand the problem
-Concrete Examples
-Break it down
-Solve or simplify
Enter fullscreen mode Exit fullscreen mode




Intro to Problem Solving

Steps to take to solve an unknown problem. How to get started when faced with uncertainty.

An algorithm is a process or sets of steps to accomplish a certain task.

Everything in programming involves some kind of algorithm.
Understanding how algorithms function is the foundation of developing strong programming skills.

To improve algorithmic programming skills, it is important to fist devise a plan for solving problems, then master common problem solving patterns.

Understand the problem

There is a process to understanding problems. Before it is possible to come up with a solution, it is important to understand what needs to be fixed.

  1. Restate the problem in your 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? Is there enough information to solve the problem?

Concrete Examples

Explore existing examples. Go out and find the solutions that may already exist for a programming problem. There is infinite amount of ways to solve programming problems, therefore, seeing solutions may show you how a proper solution may work.

Research how and why that particular solution may or may not be most successful for solving that particular problem.

Once you see enough examples and understand the fundamentals of solving problems, the existing solutions will stick out to you as being obvious how they were solved.

Break it down

Simplify a complex problem to find a simple solution.
Explicitly write out the steps you need to take. Think of how each line of code works and will function with other parts of the bigger code block. Does the interaction makes sense to program the solution in that way? Maybe there is a better way..

Solve or simplify

When you figure out what problem is and what the solution may be then it is time to solve the problem. After solving it, it is beneficial to go back and review the code and the output to see if it is working the way it suppose to. Also, it may be possible to rewrite the code in a way that is easier to read and more simplified.

Top comments (0)