How can I make myself good a problem solving & logical thinking

I am really bad at thinking a solution, e.g. I took 3 hours to build this but now if I wanna put a new feature onto it e.g. close everything else when any button is clicked and open only content div for that one. This is one example, I lack problem solving skills and logical thinking and then implementation. How can I build confidence? e.g. every problem solving / code a solution interview I do, I fail. I need from community

My background is in CSS

I use a physical notepad as an intermediary for thinking through the problem between the code editor and task

I write down the larger problem, and identify the first (usually smallest/easiest step) to solving it

I write down my ideas for solutions, and put ticks and crosses next to ideas that do or don’t work

Commit the change

Move onto the next small step

1 Like

There isn’t a silver bullet it takes work, persistence, and patience. It is like everything else in life the more you do it the better you get.

You also have to make a distinction between using the knowledge you have and learning the new things you need. You can’t come up with solutions to problems by thinking about them if they require prerequisite knowledge you do not yet have. Logical thinking does not remove the need for reading docs and learning the APIs you are using.

As an aside, you are not using the correct array method. If the method does not need to return anything it is just a forEach, not a map.

For the problem you are trying to solve event delegation is one option. You add the listener to the document (or some parent) and look at the click targets to do the logic.

1 Like

You do a lot of it. A huge part of solving a problem is being able to recognize similarities to problems you’ve solved before.

@miketandy is onto something with writing down task requirements.

  • focus on the solution
  • write down the requirements
  • what code or skills are required?
  • break down the larger problems into smaller manageable ones

Most importantly - what worked for you in the past? (no need to share, just think about how you solve problems, your problem solving style) .

Build a repertoire of design / problem solving skills.
If you can, watch some Ted Talks or other videos about design and related topics to gain inspiration.

The key here is to take a consistent approach and build on the skills you already have.

If you need help solving logical problems, consider studying logic. A few introductory videos, articles, or blogs should be enough to gain a general understanding.

@ArielLeslie mentioned, problem solving is often about being able to recognise similarities.

I’ll suggest below

  1. Buy basic maths ( aptitude, logical problems etc ), sudoku book and start spending daily 15 minutes

Basically just like our body muscles, brain has got brain muscles ( neurons ) and you need to make sure you keep building new connections. ( learn more on YT )

The more creative work we give to brain, it helps in building new neural network and improve problem solving or other skill ability gradually.

All the very best

break down this long user story into smallest chunk possible and start solving each of the smaller problems

check out more about User Story on YT

1 Like