General Problem solving tips

  1. Understand the parameters clearly. There shouldn’t be any muddled thoughts about the problem.

  2. Design the solution iteratively: a. Spec out (through tests or other means) next smallest required behaviour(s). For instance: Edge cases, input parsing etc… b. Once you’re done with one of these, Ensure it passes the spec through tests. c. Repeat until you have the solution

    For problems which seem to be extremely complex, try to reduce the problem size in the following ways: a. Shrink the input. b. Abstract away various parts into recursive steps. c. Break the problem into smaller tasks

  3. Visualize the problem and the solution, on paper etc…

  4. Work through the problem by hand, solving various cases until to recognize a pattern. Abstract this pattern away into a solution.

  5. Talk to a Rubber duck