source
- Start by asking questions and making observations about the problem. Sometimes this step feels like I'm just spinning my wheels, or stating the obvious, but I find that it gives my mind the traction needed to get started.
- Try to make the problem smaller, and solve those ones instead. Look for ways to simplify the information given. This helps me reason about the problem easier, and it can reveal different aspects that I may not have considered otherwise.
- Create lots of examples to experiment with.
- Realize that your ideas will probably be wrong more often than they are right. Don't get discouraged about it. Failed attempts can provide a lot of valuable insight to the problem.
- Work backwards if possible. This can provide another angle on the problem.
- Look for patterns and think about how they could be utilized.
- Visualize ideas by writing them down. Pencil and paper is a medium that helps me think clearly.
- Try not to jump straight into the code, sometimes it's OK, but it can also be distracting. I strive to first form a reasonable conceptual model of my approach before implementing it in code. There are times where I do the opposite though.
- Think about edge cases, but don't try to tackle everything at once. It helps to just make a note, and then revisit if necessary.
- It almost goes without saying, but practice/experience makes a big difference. For example, if I had never even heard of a graph data structure, I would not have thought to apply it to this problem. So, make practice and learning part of your daily workflow as much as possible.