Algorithms & Programming
What this unit covers
The topics below follow the published CS Principles course framework for Unit 3. This unit is worth 30–35% of the exam, so budget your time against that rather than against how long the unit takes to teach.
Lessons in this unit
- Variables, Assignment & Expressions13 min · 3 objectivesExplain what a variable is and how assignment stores a value · Trace how variable values change as statements execute · Evaluate arithmetic expressions including MOD
- Procedures & Abstraction14 min · 3 objectivesDefine a procedure with parameters and call it with arguments · Explain how procedures use abstraction to manage complexity · Trace a program that returns and uses a value from a procedure
- Lists & Iteration14 min · 3 objectivesAccess and modify list elements using 1-based indexing · Use FOR EACH and indexed loops to process every element · Trace list operations such as APPEND, INSERT, and REMOVE
- Simulation & Randomness12 min · 3 objectivesExplain what a simulation is and why simulations are useful · Describe the trade-offs between a simulation and the real experiment · Use RANDOM to model chance in a program
Formulas in Unit 3
What examiners penalize here
- `MOD` returns the *remainder*, not the quotient. Keep the classic uses ready: `n MOD 2 = 0` tests even, and `n MOD b = 0` tests whether b divides n evenly.
- The exam frames procedures around **abstraction** and **reuse** (managing complexity), not speed. Know the vocabulary precisely: a *parameter* is in the definition, an *argument* is the value you pass in the call.
- On list-tracing questions, redraw the list after **every** INSERT or REMOVE, because those operations shift the positions of all later elements. Track indices carefully — the exam builds traps out of these shifts.
- `RANDOM(a, b)` is **inclusive** of both endpoints. To model n equally likely outcomes numbered 1 to n, use `RANDOM(1, n)`. Off-by-one endpoints are a favorite exam distractor.
Practice CS Principles
Our practice bank is drawn from across the whole course rather than filtered to one unit, which is closer to how the exam asks anyway — it will not tell you which unit a question is testing.
Questions about this unit
How much of the AP Computer Science Principles exam is Unit 3?
Unit 3, Algorithms & Programming, is worth 30–35% of the CS Principles multiple-choice section according to the published course framework. Across all 5 units that makes it one of the heaviest units on the exam, and worth front-loading.
What topics are covered in CS Principles Unit 3?
Algorithms & Programming covers Variables, Procedures, Lists and Simulation.
How should I study CS Principles Unit 3?
Read the 4 lessons below first — about 55 minutes — then work practice questions on these topics. Finish with practice questions and read the explanation for every one you get right by elimination as well as the ones you miss.
All 5 units of AP Computer Science Principles
Unit names, topics and exam weights follow the published College Board course framework for AP Computer Science Principles. AP® is a trademark registered by the College Board, which does not endorse this site.