Problem Solving Tips
When you ask for help on a problem, please be prepared to describe
which step in the sequence of tips you are having trouble with (e.g.,
"B2") and your answers to the previous steps (particularly within
the same section-A or B or C).
A. Getting Started
Don't know how to get started? Describe the problem in detail:
- What are the goals of the problem?
- What are the inputs?
- What are the outputs?
- What is their relationship?
- Can you solve a small example by hand?
- Is there a part of the problem you could write code for? (and worry
about the rest later?)
- Can you describe the algorithm in words (pseudocode)?
B. Compiling Code
Is the compiler complaining of a syntax error?
- What line is the syntax error on?
- What does the text of the error mean?
- What are your hypotheses about the specific cause of the error?
C. Getting Code to Work
Is your code not behaving the way you expect?
- What evidence do you have that the code doesn t work?
- What test case doesn t work and what incorrect behavior
or output results?
- Could you come up with a simpler example that demonstrates the error?
- What lines of code might be producing the bug?
- Why hypotheses do you have for what might be causing the problem?
- How can you test these hypotheses? (e.g. writing new test cases, adding
print statements, using a debugger)
- Could you walk through an example that doesn t work:
by hand? with a debugger?
Acknowledgments
This list of tips originated as "Tips for Tutors" at http://wiki.cs.grinnell.edu/foswiki/bin/view/Main/TipsForTutors.
It was adapted by CS Teaching Tips (https://www.csteachingtips.org/tips-tutors)
and later for individual students by Jim Williams of UW Madison.