m a n d y e d i

home tags

Stages of My Problem Solving

# challenge # codingame

A few weeks ago I returned to CodinGame and after a few challenges, I realized that I have a pattern for solving them. This pattern might differ a little based on the challenge’s difficulty level.

  1. Code without severe thinking
    If it is easy I will come up with a solution. Any complicated algorithm is not involved here.

  2. The tricky one
    It might be a known problem. If I know it I implement the required algorithm. I still can come up with my idea but it turns out quickly if this is the wrong way: Even if the test cases could pass my solution times out. Ouch.

  3. Need a hint
    At this stage, I don’t know what algorithm I should use or I don’t even look for one. I just think that I’m smart enough (usually mistaken) to find out the solution. There’s also a chance that I misunderstand the challenge description.
    In order to stop my struggling and progress with the solution, I read the challenge’s discussion. If I get any hint I use it. Then I search for the required algorithm, implement it, and enjoy the success.

  4. Stuck
    I have no clue, not even from the discussion or I implemented the algorithm but something is still wrong.
    Well, the second part is not so common because it just needs more debugging. It is more common that the problem can’t be solved by simply using an algorithm. It needs some modifications.
    Either way, I Google for the problem, whether there is a post about it or just a concrete solution. The most important thing here is that I don’t copy-paste the code and be happy for the passed test cases. We are here to learn, right? So I delve into the solution, understand it then I go back to the challenge and implement it by myself using the recently acquired knowledge.

As I wrote these steps I realized that this pattern is very familiar to my work routine. The main difference is that at work I can copy (integrate) other solutions. Getting the job done is more important so I try to spend less time finding out a solution of my own. At a point, I need to come up with something unique anyway, mainly when I work on something new, some cutting edge technology. One part is to find a working algorithm or piece of code, the other part is to modify and integrate it. Of course, this process is for small challenges, for subtasks. Designing and implementing a whole program, a library or a module for a bigger software is a little bit different. I might write another post about my experiences with that. :)

Reading my steps I can highlight some things that need to be changed or oversee so I can improve my way of problem-solving.

  1. I’m easily stuck on a problem.
    Collecting any possible solutions and test all of them and keep track of what I tested, what and why did not work.

  2. I go down the wrong path.
    Sometimes I just try to solve a little problem and I don’t see the big picture. I need to stop fixing the symptom and find the root cause instead.

  3. Fix the root cause.
    I need to think through the problem, clarify the issue. Write it down etc. There’s a bunch of techniques, brainstorming can be helpful if being in a team.

So this is how I have approached and solved problems so far and it constantly changes as I am improving myself.
What is your way? Is it similar, better? What are your priorities?

Comments