Great solutions begin with understanding the problem.
Before a single line of code is written, strong developers slow down and figure out exactly what they are being asked to solve.
In AP Computer Science Principles, problem solving is not about typing fast. It is a deliberate process: understand the problem, plan an approach, build a solution, then test and refine it. Skipping the thinking stage almost always leads to programs that solve the wrong thing.
This topic introduces the foundation of Big Idea 1: Creative Development. You will learn to identify the inputs, outputs, constraints, and goals of a problem, and to break complex challenges into smaller, manageable parts.
Why this matters: On the AP exam and the Create Performance Task, you must explain how your program addresses a real need. That starts with truly understanding the problem.
The problem-solving process is a repeatable cycle.
Four connected stages take you from a vague idea to a tested, working solution.
Computer scientists rely on a structured process so that nothing important gets missed. Each stage builds on the one before it:
- Understand the problem. What are the inputs? What output is expected? What rules or limits exist?
- Decompose it. Break a big problem into smaller sub-problems that are easier to solve one at a time.
- Recognize patterns. Notice where parts of the problem look similar to things you have solved before.
- Plan the algorithm. Outline the steps before building, often using a list of steps or pseudocode.
- Test and refine. Check whether the solution actually meets the user's needs, then improve it.
This process is iterative, meaning you often loop back. Testing might reveal a misunderstanding that sends you back to the planning stage. That looping is normal and expected.
The problem-solving pipeline: Problem → Inputs → Constraints → Algorithm Plan → Testing → Refined Solution.
Read this map left to right, but notice the loop. Information from Testing feeds back into the Algorithm Plan. A solution is rarely finished on the first pass. On the exam, look for answer choices that respect this cycle rather than treating coding as a one-time, linear event.
Words that show up on every exam.
Learn these precisely. AP questions are often won or lost on definitions.
- Decomposition: breaking a large problem into smaller, more manageable sub-problems.
- Pattern recognition: identifying similarities between problems so existing solutions can be reused.
- Algorithm: a finite, step-by-step set of instructions that solves a problem or completes a task.
- Constraint: a limit or rule the solution must respect (time, memory, allowed inputs, format).
- Edge case: an unusual or extreme input at the boundary of what is expected.
- Success criteria: the measurable conditions that show the solution actually works for the user.
Memory hook: Decomposition is "divide," pattern recognition is "compare," and algorithm is "the recipe." Together they turn a confusing problem into clear steps.
What the College Board actually tests here.
Expect reasoning questions, not trivia.
AP CSP questions on problem solving usually ask you to reason about a scenario rather than recall a fact. Be ready to:
- Identify the input and output of a described program.
- Choose which constraint a solution might violate.
- Recognize when a developer is decomposing a problem.
- Explain why testing with edge cases reveals problems normal testing misses.
For the Create Performance Task, you must describe the problem your program solves and how you developed it. Practicing clear problem statements now pays off directly later.
Exam tip: When a question describes a "real-world need," the correct answer almost always connects the program's output back to that need. Watch for distractors that are technically clever but ignore the user.
Designing a homework reminder app.
Watch the process applied to a problem a real student might have.
The problem: A student keeps forgetting homework deadlines and wants an app that stores assignments and reminds them what is due.
Step 1 — Understand it. The user needs to save an assignment with a due date and later see what is upcoming. The core need is "stop forgetting deadlines."
Step 2 — Identify inputs and outputs.
- Inputs: assignment name, due date.
- Output: a saved reminder and a list of upcoming work.
- Constraints: due dates must be valid; the same assignment should not be saved twice.
- Edge cases: an empty assignment name, a due date in the past.
Step 3 — Decompose it. Saving an assignment, validating the date, and displaying reminders are three separate sub-problems.
Step 4 — Plan the core action. Only when the thinking is done do we sketch the simplest version in AP CSP pseudocode:
assignmentName ← INPUT()
dueDate ← INPUT()
DISPLAY("Reminder saved")
Notice the code is tiny compared to the planning. That is correct. The hard, valuable work happened in steps 1 through 3, and the success criterion is clear: the student no longer misses deadlines.
Where beginners trip up.
Avoiding these is half the battle on free-response questions.
- Coding before understanding. Jumping straight to typing usually means rewriting everything later.
- Ignoring constraints. A "working" program that breaks the rules of the problem is not a solution.
- Solving the wrong problem. Building something impressive that the user never asked for wastes effort.
- Missing edge cases. Forgetting empty inputs or extreme values leads to crashes and wrong answers.
- Not checking usefulness. Output that is technically correct but unhelpful still fails the user.
Reframe: "Does it run?" is the wrong first question. Ask "Does it solve the user's actual problem, including the awkward cases?"
The anatomy of a problem.
Use this to dissect any AP scenario quickly.
| Element | What it means | Reminder-app example |
|---|---|---|
| Problem | The need or goal to be addressed | Student keeps forgetting deadlines |
| Input | Data given to the program | Assignment name, due date |
| Output | Result the program produces | Saved reminder, upcoming list |
| Constraint | A rule or limit to respect | Due date must be valid |
| Edge case | Unusual or boundary input | Empty name, past date |
| Success criteria | How we know it worked | Student stops missing deadlines |
Write the problem statement first.
A two-minute habit that strengthens your Create Performance Task.
Before building anything, write one sentence: "My program helps [user] do [task] so they can [benefit]." Then list the inputs, outputs, and at least two edge cases. This forces clarity and gives you ready-made language for the written responses on the Create Performance Task.
Try it: Take any app idea you have and fill in that sentence right now. If you cannot complete it, you do not yet understand the problem well enough to build it.
Practice — attempt these now.
AP-style assessments aligned to this lesson. Time them.
AP CSP Big Idea 1 Topic 1: Problem Solving Process — Set 1
AP-style topic practice assessment
AP CSP Big Idea 1 Topic 1: Problem Solving Process — Set 2
AP-style topic practice assessment
AP CSP Big Idea 1 Topic 1: Problem Solving Process — Set 3
AP-style topic practice assessment
AP CSP Big Idea 1 Topic 1: Problem Solving Process — Set 4
AP-style topic practice assessment