Problem Solving for Programmers

Problem solving 101

Created: 2022-08-05
Tags: #fleeting


1. Understand the Problem

IF -> you don't understand all the details.
THEN -> a problem will definetly appear complex

A good problem approach strategy

  • by analyzing, studying, and planning solutions
  • Can take time and requires patience.
    • So break the problem down into small pieces

2. Plan a solution

Once you have details and understand the problem, its time for solution
-> analyze the constraints and rules
-> strategize a step-by-step solution and
-> come up with testing data or hypotheses to test against it.

As soon as you work on implementing solutions.
-> Plans will change or get abandoned
because ONE plan isn't enough to predict the whole outcome

This may seem like a waste of time
Spending time on a plan that may be scratched later
but simple step of planning gives you the idea of the problem
making it easier to adapt on the fly later on.

Start with what you know

If planed correctly, you should be able to identify many parts of the problem
it is always best to solve for the things you are familiar with first.

Divide the problem

divide your problems into chunks, solve all the chunks then solve the whole thing.

Simplify the problem

MVP (Mininum Viable Product)

Simplifying means changing the constraints or rules.
You reduce the scope of the problem to make the problem simpler.
Once you have a solution for the simpler version of the problem,
-> Will provide us with enough knowledge, experience, and research time to solve the bigger version of it later.

Getting Frustrated - I still can't solve the problem!!!

Sometimes, even when you collect all details, plan, and chunk the problem you cannot reach a solution. If you feel you are getting frustrated it is best to back up, calm down and re-state the problem. You should never spin your wheels on something that is affecting your mood.

Once you get frustrated
Getting frustrated will make you tend to
-> complicate things,
-> fail a solution
-> or pick a complex solution for the problem.

Walk away for the day or for hours, take a deep breath and explain the problem back to you out loud. Sketch what is going on to check your understanding of the problem.

Solving problems should be a logical thing and not an emotional one.

References