Week 1 Readings: Engineering Topics - jacobwendt-401-advanced-javascript/cr-js-401d3 GitHub Wiki
Week 1 - Readings: Engineering Topics
Solving Problems
Common mistakes
- The most severe mistake that occurs during a programming interview is the improper allocation of time
- measure twice and cut once
- Don't jump into the code first!
A simple set of steps
1. Read the problem completely twice.
- make sure you completely understand the problem
- A good test of this is whether or not you can explain the problem to someone else
- work through the examples and understand why the answers are correct for each one
2. Solve the problem manually with 3 sets of sample data.
- It is very important to solve the problem manually first
- solve the problem with at least three different inputs
- recognize what your brain is actually doing to solve the problem
3. Optimize the manual steps.
- It is much easier to rearrange and reconstruct and idea or algorithm in your head than it is in code
- try and optimize the actual solution or simplify it when it is still in the most easily malleable state
4. Write the manual steps as comments or pseudo-code.
- capture all the steps we created and now either put them into our editor as comments or write them as psuedo-code
5. Replace the comments or pseudo-code with real code.
- take each comment and convert it into a real line of code.
6. Optimize the real code.
Act like you make $1000/hr
"Pretend your time is worth $1000/hr. Would you spend five of them doing extra work for free? Would you waste one on being angry?" -Niklas Göke
- most people value their time at far, far less than it’s worth.
- What would your life look like if an hour of your time was worth $1000
- It takes discipline to not become “busy.”
- Are you focused, making tangible action steps towards what truly matters?
- Value your time at what it deserves to be. The higher the value, the more important and productive work you’ll do — and the less trivial and mindless tasks you’ll get caught in.
How to think like a programmer
more effective way for problem solving
- Problem solving is the meta-skill
- Try a solution.
- If that doesn’t work, try another one.
- If that doesn’t work, repeat step 2 until you luck out.
Understand what is being asked. When you can explain it in plain English, you have understood the question. Making a plan is also vital, nothing can help you if you can’t write down the exact steps. Do not try to solve one big problem. You will cry. break it into sub-problems. When stuck debug, reassess, and sidenote. Don’t expect to be great after just one week. If you want to be a good problem-solver, solve a lot of problems!
The 5 Whys and Hows
The five whys and five hows constitute a questioning process designed to drill down into the details of a problem or a solution and peel away the layers of symptoms.