Reading-Notes

PreWork Summaries :

Solving Problems:

Set of steps to solve programming problems:

  1. “Read the problem twice” to understand the problem.
  2. “Solve the problem manually” for example : solve the problem with 3 inputs to check that you understand the solutions.
  3. “Optimize the manual solution” to check if there is another way more easier to solve the problem.
  4. “Write pseudo-code or comments” to write the code we can write the previous steps in the editor as comments and write pseudo-code to know exactly the structure of the code.
  5. “Replace the comments or pseudo-code with real code” take each comment and convert it to real code line. If you have enough steps you will make this step easy.
  6. “Optimize the real code” take look on the code and try to cut out few lines aor convert some of them simpler.

Act like you make $1000/hr :


How to think like a programmer — lessons in problem solving :

Follow These Steps if you encounter a new problem :

  1. “Understand” explain the problem in simple language, write it and yo may tell another one about it.
  2. “Plan” analyze the problem and process the information, use comments help us with this.
  3. “Divide” break big problems into sub-problems easier to solve . then solve each sub-problem .we can begin with simplest one which can be solved doesn’t depend on others being solved.then connect the sub-solutions to get the origin problem solution.
  4. “Stuck” when facing a whammy :
    • Debug : “Go step by step through your solution trying to find where you went wrong”.
    • Reassess : “Look at the problem from another perspective”.
    • Research.
  5. “Practice” : solve a lot of problems to be a good problem-solver.Try to practice using : Chess puzzles, math problems, Sudoku, Monopoly ….

5 Whys:

How to Use the 5 Whys:

  1. “Assemble a Team” : connect with people who are familiar with the specifics of the problem.
  2. “Define the proble” : discuss the problem with the team and write clear problem statement that all team member agree on.
  3. “Ask the first Why?” : ask the team about the problem occuring and the answers will account the things that happened.
  4. “Ask Why? four more times” : for each answer ask four whys, each why response to the answer that recorded.

image1

image2

  1. “Know when to stop” : “ if you’re not sure that you’ve uncovered the real root cause, consider using a more in-depth problem-solving technique”.
  2. “Adress the root cause” : discuss and agree on the counter-measures that will prevent the problem from recurring.
  3. “Monitor your measures “ : the measures must minimize the initial problem, you may need to replace them and repeate the 5 whys process .

Sources:

  1. link1
  2. link2
  3. link3
  4. link4