Hacker News new | ask | show | jobs
Ask HN: How to improve problem solving and reasoning skills
2 points by ayEl 3443 days ago
As a CS student in my final year, I still have difficulties solving what I would characterise as relatively easy problems, I usually just start writing code as soon as I read the problem and just keep modifying it and adding stuff to it, I have tried writing algorithms on paper a few times but I haven't noticed any difference really since I don't really "think/reason" about what I'm writing, I don't know if my description is relatable but that's how it feels, it's more like me writing whatever pops in my mind rather than logically trying to solve the problem.

So to circle back to my question, how would you go about dealing with this?

2 comments

Solving a problem by experimenting is rarely useful. I'd call it accidental solution. You can improve by doing it the hard way. Do not write down anything unless you understand why you do it. As a test, try to answer the following question: "Why will it work?" It is also useful to think about other solutions before committing to one. Try to come up with pros and cons.

You can improve your reasoning skills by fixing bugs. First observe the bug, try to make a hypothesis. Try to support it by reading the code (do not run it, don't use a debugger at this point). Once you have a plan, find evidence that support your theory. Once your theory is right, find a solution, and answer the question "why".

It will take time, but you will improve over time. For me, the key is patience.

Thanks for your advice, I'll experiment with this method.

And yeah that's actually how I used to find solutions: by accident. I just keep tweaking the code and running it until it gives the solution I want.

I never really considered this a problem, but I'm glad I'm aware of it now, it's better late than never.

Have you thought about what sort of response your question might produce?

As an exercise, give your best shot at answering your own question.

Yeah, I thought it might produce some good suggestions that worked for other people and that I could try.

Hopefully people who actually have something constructive to share will see this question too.