Skip to content

Latest commit

 

History

History
86 lines (53 loc) · 2.92 KB

File metadata and controls

86 lines (53 loc) · 2.92 KB

Get Ready for 401 Prep Work

How to Solve Programming Problems

Common mistakes

If you have heard the saying “measure twice and cut once,” then you are probably familiar with the idea of spending upfront time to make sure something is done right, rather than diving right in.

The most common mistake I see when conducting interviews or watching someone try to solve a programming problem is they try to start writing code as soon as possible.

A simple set of steps

  1. Read the problem completely twice.
  1. Solve the problem manually with 3 sets of sample data.
  2. Optimize the manual steps.
  3. Write the manual steps as comments or pseudo-code.
  4. Replace the comments or pseudo-code with real code.
  5. Optimize the real code.

Important steps should know

  • Read the problem completely twice
  • Solve the problem manually
  • Optimize the manual solution
  • Write pseudo-code or comments
  • Replace comments with real code
  • Optimize the real code

Act like you make $1000-hr

  • Don't spend hours watching low-quality television and social media when they should be productive and effective.
  • The most successful people I know are not busy. They’re focused.”
  • Extremely successful people don’t tolerate busywork or distraction. They have crystal clear vision on their goals, and do what they need to do to get there, every single day.
  • Every time you say yes to something, it means you’re saying “no” to a dozen other opportunities. The world’s most successful and extraordinary people say no to almost everything, but yes to a few things.

How to think like a programmer

Problem solving is the meta-skill.

Why is this important?

Problem-solving skills are almost unanimously the most important qualification that employers look for….more than programming languages proficiency, debugging, and system design.

Problem solving

  1. Try a solution.
  2. If that doesn’t work, try another one.
  3. If that doesn’t work, repeat step 2 until you luck out.

1. Understand

Know exactly what is being asked. Most hard problems are hard because you don’t understand them (hence why this is the first step).

2. Plan

Don’t dive right into solving without a plan (and somehow hope you can muddle your way through). Plan your solution!

3. Divide

Pay attention. This is the most important step of all.

Practice

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

How to Use the 5 Whys

1. Assemble a Team

2. Define the Problem

3.Ask the First "Why?"

4. Ask "Why?" Four More Times

5. Know When to Stop