Skip to content

Instantly share code, notes, and snippets.

@pshushereba
Last active July 17, 2020 00:45
Show Gist options
  • Save pshushereba/c30905d17e4dfb40d408fa03b3619721 to your computer and use it in GitHub Desktop.
Save pshushereba/c30905d17e4dfb40d408fa03b3619721 to your computer and use it in GitHub Desktop.
Problem Solving Framework
UNDERSTAND THE PROBLEM
Can I restate the problem in my own words?
What are the inputs that go into the problem?
What are the outputs that should come from the solution to the problem?
Can the outputs be determined from the inputs? In other words, do I have enough information to solve the problem? (You may not be able to answer this question until you set about solving the problem. That's okay; it's still worth considering the question at this early stage.)
How should I label the important pieces of data that are a part of the problem?
EXPLORE EXAMPLES
User Stories?
Unit Tests?
- Use the simple and complex examples to generate tests for the solution that you wrote.
Simple Examples
- A explanation example. The kind of example that you would see in a textbook example.
Complex Examples
- Inputs that test the constraints of the function. Edge cases.
Examples with Empty Inputs
Examples with Invalid Inputs
BREAK IT DOWN
Always offer two types of solutions
Like a TO-DO list.
The problem will always be a series of smaller problems.
SOLVE THE PROBLEM
If you can't...
SOLVE A SIMPLER PROBLEM!
Find the core difficulty in what you're trying to do
Temporarily ignore that difficulty
Write a simplified solution
Then incorporate that difficulty back in
REFACTORING QUESTIONS
Can you check the result?
Can you derive the result differently?
Can you understand it at a glance?
Can you use the result or method for some other problem?
Can you improve the performance of your solution?
Can you think of other ways to refactor?
How have other people solved this problem?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment