AP exam review verified for 2027

AP Computer Science Principles Unit 3 Review: Algorithms & Programming Fundamentals

Review AP CSP Unit 3 to build a complete picture of how algorithms and programs work, from variables and loops to procedural abstraction, binary search, and the limits of what computers can solve. This unit covers the largest share of programming concepts you will trace, write, and evaluate on the AP exam.

Use the topic guides, key terms, and practice questions available on Fiveable to work through each concept and check your understanding before exam day.

What is AP Computer Science Principles unit 3?

Unit 3 is the programming core of AP CSP. It introduces every major building block used to write and analyze programs: how data is stored, how decisions are made, how repetition works, and how procedures organize complexity. The unit ends by asking bigger questions about what algorithms can and cannot do.

An algorithm is a finite set of instructions that accomplishes a task. Programs implement algorithms using sequencing (steps in order), selection (conditionals), and iteration (loops). Abstraction, through named variables, lists, and procedures, manages complexity so programs stay readable and reusable.

Data and expressions

Variables hold one value at a time using the assignment operator (left-arrow). Lists store ordered collections indexed from 1. Strings are ordered character sequences. Arithmetic operators include +, -, *, /, and MOD. Boolean expressions use relational operators (=, not-equal, <, >, <=, >=) and logical operators (NOT, AND, OR).

Control structures

Sequencing runs statements top to bottom. Selection uses IF and IF/ELSE blocks to branch based on a Boolean condition. Nested conditionals place one IF inside another. Iteration uses REPEAT n TIMES or REPEAT UNTIL(condition) to repeat a block; an infinite loop occurs when the stopping condition never becomes true.

Abstraction and algorithm limits

Procedural abstraction names a process so callers know what it does without knowing how. Libraries provide reusable procedures accessed through an API. Binary search requires sorted data and is more efficient than linear search. Algorithms run in reasonable (polynomial) or unreasonable (exponential/factorial) time. Some problems are undecidable: no algorithm can always give a correct yes/no answer.

Why abstraction is the central idea

Every major concept in Unit 3 is a form of abstraction. A variable abstracts a memory location. A list abstracts a collection. A procedure abstracts a process. A simulation abstracts a real-world system. Recognizing what each abstraction hides and what it exposes is the skill the AP exam tests most consistently across this unit.

AP Computer Science Principles unit 3 topics

3.1

Variables and Assignments

Variables hold one value at a time. The left-arrow operator assigns a value. The stored value is always the most recent assignment. Data types include numbers, Booleans, strings, and lists.

open guide
3.2

Data Abstraction

Lists are ordered sequences indexed from 1. Data abstraction names a collection so programs work with the group rather than individual storage details, reducing complexity.

open guide
3.3

Mathematical Expressions

Algorithms use sequencing, selection, and iteration. Arithmetic operators include +, -, *, /, and MOD. Standard order of operations applies; MOD has the same precedence as * and /.

open guide
3.4

Strings

String concatenation joins strings end-to-end. A substring is a portion of an existing string. Strings are ordered sequences of characters.

open guide
3.5

Boolean Expressions

Boolean values are true or false. Relational operators (=, not-equal, <, >, <=, >=) compare values. Logical operators NOT, AND, and OR combine Boolean expressions.

open guide
3.6

Conditionals

IF and IF/ELSE statements execute different blocks based on whether a Boolean condition is true or false. Selection determines which part of an algorithm runs.

open guide
3.7

Nested Conditionals

Nested conditionals place one IF inside another. The inner condition is only evaluated when the outer condition is true. Tracing all paths is essential.

open guide
3.8

Iteration

REPEAT n TIMES runs a block exactly n times. REPEAT UNTIL(condition) repeats until the condition is true, checking before each pass. An infinite loop occurs when the condition never becomes true.

open guide
3.9

Developing Algorithms

Algorithms can be created, combined, or modified. Two algorithms are equivalent if they always produce the same result. Common building blocks include max/min, sum/average, divisibility checks, and maze traversal.

open guide
3.10

Lists

List operations include indexing (aList[i]), INSERT, APPEND, REMOVE, and LENGTH. FOR EACH traversal visits every element. Linear search checks elements one by one.

open guide
3.11

Binary Search

Binary search requires sorted data. It checks the middle element and eliminates half the remaining data each step, making it more efficient than linear search on large sorted data sets.

open guide
3.12

Calling Procedures

A procedure call passes arguments to parameters, executes the body, and returns control to the call site. A RETURN statement sends a value back and ends the procedure.

open guide
3.13

Developing Procedures

Procedural abstraction names a process so callers only need to know inputs and outputs. Modularity divides a program into subprograms. Parameters generalize procedures for reuse.

open guide
3.14

Libraries

A library is a collection of pre-written procedures. An API specifies how those procedures behave. Documentation is necessary to use a library correctly.

open guide
3.15

Random Values

RANDOM(a, b) returns an integer from a to b inclusive, with each value equally likely. Programs using RANDOM may produce different results on each execution.

open guide
3.16

Simulations

Simulations are abstractions of real-world phenomena. They use changing values to model behavior, allow investigation without real-world constraints, and can contain bias from inclusion or exclusion choices.

open guide
3.17

Algorithmic Efficiency

Polynomial-time algorithms run in reasonable time. Exponential and factorial algorithms run in unreasonable time. Heuristics provide approximate solutions when exact solutions are impractical.

open guide
3.18

Undecidable Problems

A decidable problem always has an algorithmic yes/no solution. An undecidable problem has no algorithm that works correctly for all inputs, though some specific instances may still be solvable.

open guide
guide

Big Idea 3: Algorithms and Programming

Big Idea 3 is 30-35% of the AP Computer Science Principles exam. Review all 18 topics: variables, conditionals, loops, lists, procedures, and efficiency.

open guide
practice snapshot

Hardest AP Computer Principles unit 3 topics

This snapshot uses Fiveable practice activity to show where students tend to miss questions and which review moves are worth prioritizing first.

68%average MCQ accuracy

Across 27k multiple-choice practice attempts for this unit.

27kMCQ attempts

Practice activity included in this snapshot.

Hardest topics in unit 3

MCQ miss rate
3.10

Review Lists with attention to how the concept appears in AP-style source and evidence questions.

46%3,315 tries
3.17

Review Algorithmic Efficiency with attention to how the concept appears in AP-style source and evidence questions.

39%1,674 tries
3.14

Review Libraries with attention to how the concept appears in AP-style source and evidence questions.

36%743 tries
3.1

Review Variables and Assignments with attention to how the concept appears in AP-style source and evidence questions.

34%2,260 tries

Unit 3 review notes

3.1

Variables and Assignments

A variable is an abstraction that holds one value at a time. The AP exam reference sheet uses the left-arrow operator (a <- expression) to assign a value. The value stored is always the most recent assignment. Meaningful variable names improve readability.

  • Assignment operator: The left-arrow <- evaluates the expression on the right and stores a copy of the result in the variable on the left.
  • Most-recent-assignment rule: If a variable is assigned multiple times, its current value is whatever was assigned last. Tracing line by line is the reliable method.
  • Data types: AP CSP variables can hold numbers, Booleans (true/false), strings, or lists. The type affects what operations make sense on the value.
  • Sequence of assignments: When b <- a is followed by a <- 2, b still holds the original value of a because assignment copies the value at that moment.
Trace this sequence: a <- 3, b <- a, a <- 10. What does b hold? Answer: 3, because b was assigned a copy of a before a changed.
3.2

Data Abstraction and Lists

A list is an ordered sequence of elements, each identified by an index starting at 1 on the AP exam. Data abstraction gives a collection a single name, hiding the details of how individual elements are stored. This makes programs easier to build and maintain.

  • Index: A natural number that identifies an element's position in a list. The first element is at index 1 in AP pseudocode.
  • Data abstraction: Naming a collection of values so the program can refer to the group without specifying every element's storage detail.
  • List as a variable: A list variable holds the entire ordered collection. Assigning one list to another copies the list at that moment.
  • Managing complexity: Using a list instead of separate variables reduces code length and makes it easier to add, remove, or process related values together.
If myList = [10, 20, 30], what is myList[2]? Answer: 20, because AP pseudocode uses 1-based indexing.
3.3

Expressions: Arithmetic and Strings

An expression evaluates to a single value. Arithmetic expressions use +, -, *, /, and MOD. MOD returns the remainder and has the same precedence as * and /. String concatenation joins two strings end-to-end. A substring is a portion of an existing string.

  • MOD operator: a MOD b returns the remainder when a is divided by b. Example: 17 MOD 5 = 2. Useful for checking divisibility and cycling through values.
  • Order of operations: Standard math precedence applies. MOD, *, and / are evaluated before + and -. Parentheses override default precedence.
  • String concatenation: Joins two or more strings into one new string placed end-to-end. For example, 'hello' + ' world' produces 'hello world'.
  • Substring: A part of an existing string extracted by specifying a start and end position.
What does (14 MOD 4) + 1 evaluate to? Step through: 14 MOD 4 = 2, then 2 + 1 = 3.
3.5

Boolean Expressions

A Boolean value is either true or false. Relational operators compare two values and produce a Boolean. Logical operators combine Boolean values. The AP reference sheet provides NOT, AND, and OR.

  • Relational operators: =, not-equal, <, >, <=, >= compare two values and return true or false.
  • NOT: Reverses a Boolean: NOT true = false, NOT false = true.
  • AND: True only when both conditions are true; false otherwise.
  • OR: True when at least one condition is true; false only when both are false.
Evaluate: (3 > 2) AND (5 = 6). The first condition is true, the second is false. AND requires both to be true, so the result is false.
OperatorReturns true when
NOT conditioncondition is false
condition1 AND condition2both conditions are true
condition1 OR condition2at least one condition is true
3.6

Conditionals and Nested Conditionals

Selection uses IF and IF/ELSE statements to execute different code blocks based on a Boolean condition. Nested conditionals place one IF inside another, allowing more specific branching. Tracing every possible path is the key exam skill.

  • IF statement: Executes a block only when the condition is true; does nothing if the condition is false.
  • IF/ELSE statement: Executes the first block when the condition is true and the second block when it is false. Exactly one block always runs.
  • Nested conditional: A conditional statement placed inside another conditional's block. The inner condition is only evaluated if the outer condition is true.
  • Tracing execution paths: To determine output, substitute specific values and follow which branches execute. Check every branch, not just the first one.
An IF checks x > 0. Inside that block, another IF checks x > 10. If x = 5, which blocks execute? The outer block runs (5 > 0 is true), but the inner block does not (5 > 10 is false).
3.8

Iteration

Iteration repeats a block of statements. REPEAT n TIMES runs the block exactly n times. REPEAT UNTIL(condition) runs the block until the condition becomes true, checking the condition before each iteration. If the condition is true at the start, the block never runs.

  • REPEAT n TIMES: Executes the block exactly n times regardless of what happens inside the block.
  • REPEAT UNTIL(condition): Checks the condition before each pass. Stops when the condition is true. If true initially, the block runs zero times.
  • Infinite loop: Occurs in REPEAT UNTIL when the stopping condition can never become true. The program runs forever without terminating.
  • Accumulator pattern: A variable initialized before the loop that collects a running total, count, or other value updated each iteration.
A REPEAT UNTIL(x >= 5) loop starts with x = 5. How many times does the body run? Zero times, because the condition is already true before the first iteration.
3.9

Developing Algorithms

Algorithms can be created from scratch, by combining existing algorithms, or by modifying them. Two algorithms that look different can produce the same result. Some conditional statements can be rewritten as equivalent Boolean expressions and vice versa. Knowing common building-block algorithms speeds up development.

  • Algorithm equivalence: Two algorithms are equivalent if they always produce the same result or side effect for every possible input.
  • Building-block algorithms: Common patterns include finding a maximum or minimum, computing a sum or average, checking divisibility with MOD, and navigating a robot through a maze.
  • Combining algorithms: Using a correct existing algorithm as a component of a new one reduces development time and the chance of introducing errors.
  • Conditional-Boolean equivalence: An IF/ELSE that sets a variable to true or false can often be rewritten as a single Boolean expression assigned directly to that variable.
Two algorithms both find the maximum of two numbers but use different conditional structures. Are they equivalent? Yes, if they return the same value for every possible pair of inputs.
3.10

List Operations and Traversal

The AP reference sheet provides specific list operations. Indexing starts at 1. INSERT shifts elements right and increases length. REMOVE shifts elements left and decreases length. APPEND adds to the end. FOR EACH traversal visits every element in order.

  • aList[i]: Accesses the element at index i. The first element is aList[1].
  • INSERT(aList, i, value): Places value at index i, shifting all elements at index i and beyond one position to the right. List length increases by 1.
  • REMOVE(aList, i): Removes the element at index i, shifting all elements after it one position to the left. List length decreases by 1.
  • FOR EACH item IN aList: Assigns item to each element in order from index 1 to the last index, executing the block once per element.
  • Linear search: Checks each element one by one until the target is found or the list ends. Works on unsorted data.
After INSERT(myList, 2, 99) on [10, 20, 30], what is myList? Answer: [10, 99, 20, 30]. The value 99 is placed at index 2 and the original elements shift right.
3.11

Binary Search

Binary search finds a value in a sorted data set by checking the middle element, then eliminating the half that cannot contain the target, and repeating. It requires sorted data and is more efficient than linear search for large data sets.

  • Sorted data requirement: Binary search only works correctly when the data is already sorted. Applying it to unsorted data produces unreliable results.
  • Halving the search space: Each iteration eliminates half the remaining elements, so the number of steps grows much more slowly than the data set size.
  • Efficiency advantage: Binary search reaches a result in far fewer steps than linear search when the data set is large and sorted.
A sorted list has 16 elements. In the worst case, how many times does binary search check the middle before concluding the value is absent? At most 4 times, because 16 halves to 8, 4, 2, 1.
Search typeData requirementRelative efficiency on large sorted data
Linear (sequential) searchNone; works on unsorted dataSlower; checks up to every element
Binary searchData must be sortedFaster; eliminates half the remaining elements each step
3.12

Calling and Developing Procedures

A procedure is a named group of instructions with optional parameters and a return value. Calling a procedure passes arguments to its parameters, executes the body, and returns control to the call site. Procedural abstraction lets you use a procedure by knowing what it does, not how it works internally. Modularity breaks a program into subprograms, each solving one part of the problem.

  • Parameters vs arguments: Parameters are the input variables listed in the procedure definition. Arguments are the actual values passed when the procedure is called.
  • RETURN statement: Sends a value back to the call site and immediately ends the procedure. The returned value can be stored in a variable.
  • Flow of control: A procedure call interrupts sequential execution, runs the procedure body, then resumes at the line immediately after the call.
  • Procedural abstraction: Naming a process so callers only need to know its inputs and outputs, not its internal steps. Enables code reuse and simplifies debugging.
  • Modularity: Dividing a program into separate procedures, each responsible for one subproblem, so the overall program is easier to read, test, and modify.
A procedure square(n) returns n * n. The call result <- square(4) runs the procedure with n = 4 and stores 16 in result. What is result? 16.
3.14

Libraries and APIs

A software library is a collection of pre-written procedures available for use in new programs. An API specifies how those procedures behave and how to call them. Documentation is required to understand what a library provides and how to use it correctly.

  • Library: A collection of procedures that can be imported and called in a program without rewriting the underlying code.
  • API: A specification that defines the inputs, outputs, and behavior of each procedure in a library. It is the contract between the library and the programmer using it.
  • Documentation: Written descriptions of what each library procedure does, what arguments it accepts, and what it returns. Without documentation, an API cannot be used reliably.
  • Complexity reduction: Libraries allow programmers to build on existing correct code, reducing the amount of new code that must be written and tested.
Why is API documentation necessary even when a library is available? Because the API specification tells you what arguments to pass and what the procedure returns; without it, you cannot call the procedure correctly.
3.15

Random Values

RANDOM(a, b) returns a random integer from a to b, inclusive. Each integer in the range is equally likely. Because the result varies each run, programs using RANDOM can produce different outputs on different executions.

  • RANDOM(a, b): Generates and returns one integer chosen uniformly at random from a through b, including both endpoints. RANDOM(1, 6) simulates a six-sided die.
  • Inclusive endpoints: Both a and b are possible results. The total number of possible values is b - a + 1.
  • Non-deterministic output: A program that calls RANDOM may produce a different result each time it runs, which is useful for simulations, games, and randomized algorithms.
RANDOM(3, 7) is called. List all possible results. Answer: 3, 4, 5, 6, 7. Each is equally likely.
3.16

Simulations

A simulation is an abstraction of a real-world object or phenomenon built for a specific purpose. It uses changing values to model a system's behavior, allowing investigation without the cost, danger, or scale of the real event. Simulations simplify reality and can introduce bias based on what is included or excluded.

  • Simulation as abstraction: A simulation removes or simplifies real-world details to focus on the aspects relevant to the question being investigated.
  • Simulation bias: The choices about which real-world elements to include or exclude shape the simulation's results. Leaving out a key factor can make results misleading.
  • When simulations are useful: Simulations are most valuable when real experiments are too expensive, too dangerous, too slow, too fast, or physically impossible to run.
  • Random values in simulations: RANDOM is often used inside simulations to model unpredictable real-world variation, such as weather events or population behavior.
A simulation of car crash safety tests is run instead of using real cars. What is one advantage and one limitation? Advantage: no physical risk or cost. Limitation: the simulation may not capture every real-world variable, introducing bias.
3.17

Algorithmic Efficiency

Efficiency measures how many computational resources an algorithm uses as input size grows. Algorithms that run in polynomial time (constant, linear, quadratic) are considered to run in reasonable time. Algorithms with exponential or factorial growth run in unreasonable time and become impractical for large inputs. Heuristics provide approximate solutions when exact solutions would take too long.

  • Reasonable time: Polynomial efficiency or lower. The algorithm remains practical as input size increases.
  • Unreasonable time: Exponential or factorial efficiency. The algorithm becomes impractical very quickly as input size grows even slightly.
  • Heuristic: An approach that finds a good-enough approximate solution when finding the optimal solution would require unreasonable time.
  • Decision vs optimization problem: A decision problem asks yes or no (is there a path from A to B?). An optimization problem asks for the best solution (what is the shortest path from A to B?).
An algorithm doubles its steps every time one element is added to the input. Is this reasonable or unreasonable time? Unreasonable, because doubling per element is exponential growth.
Efficiency typeGrowth patternPractical for large inputs?
ConstantSame steps regardless of input sizeYes
LinearSteps grow proportionally with input sizeYes
Polynomial (quadratic, cubic)Steps grow as a power of input sizeGenerally yes
ExponentialSteps double (or more) with each added input elementNo
FactorialSteps grow as n! of input sizeNo
3.18

Undecidable Problems

A decidable problem is one for which an algorithm can always produce a correct yes or no answer for every input. An undecidable problem is one for which no such algorithm exists. Some specific instances of an undecidable problem may still be solvable, but no single algorithm handles all instances correctly.

  • Decidable problem: A decision problem where an algorithm can be written that always gives the correct yes or no answer for every possible input. Example: is a number even?
  • Undecidable problem: A decision problem where no algorithm can always give a correct yes or no answer for every possible input, no matter how the algorithm is designed.
  • Instance-specific solvability: An undecidable problem may have some inputs for which an algorithm gives the right answer, but there is no algorithm that works correctly for all inputs.
Is 'Is this number divisible by 3?' decidable or undecidable? Decidable, because an algorithm using MOD can always give the correct answer for any integer input.
Problem typeAlgorithm always correct?Example
DecidableYes, for all inputsIs the number even? (use MOD 2)
UndecidableNo algorithm works for all inputsHalting problem: does this program stop for this input?

Practice AP Computer Science Principles unit 3 questions

Try AP-style multiple-choice questions and written prompts after you review the notes.

Example AP-style MCQs

open all practice
MCQ

AP-style practice question

Question

The variable age is initialized to 60. The following code segment is executed:

type = "Regular" if (age > 18) { if (age > 65) { type = "Senior" } else { type = "Adult" } }

What is the final value of type?

The type variable is set to "Adult"

The type variable is set to "Senior"

The type variable is set to "Regular"

The type variable is set to "Child"

MCQ

AP-style practice question

Question

A robot's navigation algorithm uses a loop to MoveForward() repeatedly. The current loop condition is REPEAT UNTIL (onGoal), which stops the robot only when it reaches the goal. A programmer wants to modify the algorithm so the robot also stops if it hits a wall (onWall is true). Which loop condition achieves this?

Change the condition to REPEAT UNTIL (onGoal OR onWall)

Change the condition to REPEAT UNTIL (onGoal AND onWall)

Change the condition to REPEAT UNTIL (NOT onGoal OR onWall)

Change the condition to REPEAT UNTIL (NOT onGoal AND onWall)

Key terms

TermDefinition
AlgorithmA finite set of instructions that accomplishes a specific task. Every algorithm can be built from sequencing, selection, and iteration.
VariableA named abstraction in a program that holds one value at a time. The stored value is always the most recent assignment.
SequencingExecuting code statements in the order they appear, top to bottom, with each step completing before the next begins.
SelectionUsing IF or IF/ELSE statements to execute different blocks of code based on whether a Boolean condition is true or false.
Conditional StatementsIF and IF/ELSE blocks that branch program execution based on a Boolean expression. Nested conditionals place one inside another.
REPEAT UNTIL(condition)An iteration statement that repeats a block until the condition evaluates to true. If the condition is true initially, the block runs zero times.
Procedural AbstractionNaming a process in a procedure so callers know what it does without needing to know how it works internally. Enables code reuse and modularity.
ParametersInput variables listed in a procedure definition. They receive copies of the arguments passed when the procedure is called.
modulus operatora MOD b returns the remainder when a is divided by b. Example: 17 MOD 5 = 2. Used for divisibility checks and cycling through values.
Linear SearchChecks each element in a list one by one until the target is found or the list ends. Works on unsorted data.
RANDOM(a, b)Returns a random integer from a to b inclusive, with each value equally likely. Programs using it may produce different results each run.
HeuristicAn approach that finds a good-enough approximate solution when finding the exact optimal solution would require unreasonable time.
Decidable ProblemA decision problem for which an algorithm can always produce a correct yes or no answer for every possible input.
reasonable timeAlgorithms with polynomial efficiency or lower that remain practical as input size increases.
LibraryA collection of pre-written procedures that can be used in new programs. An API specifies how those procedures behave; documentation explains how to use them.

Common unit 3 mistakes

Using 0-based indexing instead of 1-based

AP pseudocode lists start at index 1, not 0. Writing aList[0] to access the first element is incorrect on the exam. Always use aList[1] for the first element.

Misreading REPEAT UNTIL as REPEAT WHILE

REPEAT UNTIL stops when the condition is true, not false. Students often reverse the logic. If the condition is already true before the loop, the body runs zero times.

Forgetting that assignment copies the value at that moment

After b <- a and then a <- 10, b still holds the original value of a. Changing a later does not change b because assignment is a copy, not a link.

Confusing parameters and arguments

Parameters are the variable names in the procedure definition. Arguments are the actual values passed in the call. Mixing up which is which leads to errors when tracing procedure calls.

Applying binary search to unsorted data

Binary search only works on sorted data. Applying it to an unsorted list can produce a wrong answer or miss the target entirely. Always check the sorted requirement first.

How this unit shows up on the AP exam

Code tracing on multiple-choice questions

A large portion of AP CSP multiple-choice questions present a pseudocode segment and ask what value a variable holds, what the output is, or how many times a loop runs. The skill is substituting specific values and following every assignment, conditional branch, and iteration step by step using the AP reference sheet notation.

Explaining abstraction and complexity management

Questions ask students to explain why a list or procedure makes a program easier to develop or maintain. Strong responses name the specific abstraction (list, procedure, library), describe what detail it hides, and connect it to reducing code duplication or making the program easier to modify.

Comparing algorithms and identifying limits

The exam asks students to compare two algorithms for equivalence or efficiency, identify whether binary search or linear search is appropriate for a given scenario, classify an algorithm as running in reasonable or unreasonable time, and recognize that some problems are undecidable. These questions require applying definitions precisely rather than recalling general descriptions.

Final unit 3 review checklist

  • Trace variable assignmentsPractice following a sequence of assignment statements line by line, applying the most-recent-assignment rule to determine what each variable holds at any point.
  • Evaluate Boolean and arithmetic expressionsWork through expressions using MOD, relational operators, and NOT/AND/OR. Apply order of operations and check truth values step by step.
  • Trace conditionals and loopsGiven a code segment with IF/ELSE or REPEAT UNTIL, substitute specific input values and follow every branch or iteration to determine the output or side effect.
  • Apply list operations correctlyPractice INSERT, REMOVE, APPEND, and FOR EACH traversal using 1-based indexing. Track how list length changes after each operation.
  • Explain binary search requirements and efficiencyState that binary search requires sorted data and explain why it reaches a result faster than linear search on large sorted data sets.
  • Distinguish procedural and data abstractionExplain how procedures hide implementation details and how lists group related values under one name, and connect both to managing program complexity.
  • Classify algorithm efficiency and problem decidabilityIdentify whether an algorithm runs in reasonable or unreasonable time, recognize when a heuristic is appropriate, and distinguish decidable from undecidable problems.

How to study unit 3

Start with variables, expressions, and data types (3.1-3.4)Review the left-arrow assignment operator, trace multi-step assignment sequences, and practice evaluating arithmetic expressions with MOD. Then work through string concatenation and substring examples using the topic guides for 3.1, 3.2, 3.3, and 3.4.
Build fluency with Boolean logic and control structures (3.5-3.8)Practice writing and evaluating NOT, AND, and OR expressions. Then trace IF, IF/ELSE, nested conditionals, REPEAT n TIMES, and REPEAT UNTIL with specific input values. Use the topic guides for 3.5 through 3.8 and test yourself with available practice questions.
Work through algorithm design and list operations (3.9-3.11)Review common building-block algorithms (max, min, sum, divisibility). Practice all list operations with 1-based indexing, including INSERT and REMOVE with their shifting behavior. Then study binary search requirements and efficiency using the topic guides for 3.9, 3.10, and 3.11.
Review procedures, libraries, and random values (3.12-3.15)Trace procedure calls by mapping arguments to parameters and following flow of control through RETURN. Explain how procedural abstraction and modularity manage complexity. Review what APIs and documentation provide, and practice evaluating RANDOM(a, b) expressions for all possible results.
Finish with simulations, efficiency, and limits (3.16-3.18)Explain what a simulation abstracts and where bias can enter. Classify algorithms as reasonable or unreasonable time and identify when a heuristic is appropriate. Distinguish decidable from undecidable problems using the topic guides for 3.16, 3.17, and 3.18. Use the AP score calculator to estimate your overall score after completing practice questions.

More ways to review

Topic study guides

Open the individual guides for Unit 3 when you want a closer review of one topic.

browse guides

FRQ practice

Practice free-response reasoning and compare your answer with scoring guidance.

practice FRQs

Cram archive videos

Watch past review streams filtered to Unit 3 when you want a video walkthrough.

open videos

Cheatsheets

Use unit cheatsheets for a quick visual review after you work through the notes.

open cheatsheets

Score calculator

Estimate your broader AP score goal after you review the course and exam format.

open calculator

Frequently Asked Questions

What topics are covered in AP CSP Unit 3?

AP CSP Unit 3 covers 18 topics across algorithms and programming: Variables and Assignments, Data Abstraction, Mathematical Expressions, Strings, Boolean Expressions, Conditionals, Nested Conditionals, Iteration, Developing Algorithms, Lists, Binary Search, Calling and Developing Procedures, Libraries, Random Values, Simulations, Algorithmic Efficiency, and Undecidable Problems. These topics build on each other, starting with basic variables and expressions, then moving into control flow (conditionals and iteration), and finally tackling more advanced ideas like procedural abstraction and the limits of computation. See the full breakdown at /ap-comp-sci-p/unit-3.

What's on the AP CSP Unit 3 progress check (MCQ and FRQ)?

The AP CSP Unit 3 progress check includes both MCQ and FRQ parts drawn from the unit's 18 topics. The MCQ section tests concepts like Boolean expressions, conditionals, iteration, lists, and binary search. The FRQ part typically asks you to trace or write code segments involving procedures, variables, and algorithms. The progress check is College Board's built-in checkpoint in AP Classroom, so it closely mirrors the language and format of the actual AP exam. Topics like Developing Algorithms (3.9), Calling Procedures (3.12), and Algorithmic Efficiency (3.17) are especially common targets. Practicing with matched questions at /ap-comp-sci-p/unit-3 is a solid way to prepare before you take the progress check.

How do I practice AP CSP Unit 3 FRQs?

AP CSP Unit 3 FRQs most often pull from topics like Developing Procedures (3.13), Developing Algorithms (3.9), Lists (3.10), and Simulations (3.16). These questions ask you to write or trace code, explain what a procedure does, or describe how an algorithm handles specific inputs. To practice effectively, try writing short code segments by hand for each of those topics, then explain your logic out loud as if you're answering a written-response prompt. Focus on being precise about sequencing, selection, and iteration since graders look for correct use of those structures. You can find FRQ-style practice questions at /ap-comp-sci-p/unit-3.

Where can I find AP CSP Unit 3 practice questions?

You can find AP CSP Unit 3 multiple-choice and practice test questions at /ap-comp-sci-p/unit-3. That page has resources covering all 18 topics in the unit, from Variables and Boolean Expressions to Binary Search and Undecidable Problems. For the best MCQ prep, look for questions that test conditionals, iteration, and list operations since those show up most on the exam. Mixing topic-specific practice with full unit practice tests helps you spot which concepts still need work before exam day.

How should I study AP CSP Unit 3?

Start AP CSP Unit 3 by building a strong foundation in variables, expressions, and Boolean logic before moving to conditionals and iteration, since every later topic depends on those. Then work through lists, procedures, and algorithms in order, writing small code examples for each concept rather than just reading about them. Here's a practical study approach: - **Trace code by hand.** For topics like Binary Search (3.11) and Nested Conditionals (3.7), manually step through examples to see exactly what happens at each line. - **Write your own procedures.** Developing Procedures (3.13) and Developing Algorithms (3.9) are high-value topics. Writing short programs from scratch builds the skill faster than reviewing notes. - **Connect simulations to randomness.** Topics 3.15 and 3.16 (Random Values and Simulations) are often tested together, so study them as a pair. - **Tackle efficiency and limits last.** Algorithmic Efficiency (3.17) and Undecidable Problems (3.18) are conceptual, so save them for after you're comfortable with the coding topics. Visit /ap-comp-sci-p/unit-3 for topic guides and practice questions to check your understanding along the way.

Ready to review Unit 3?Start with the notes, check the topic cards, and use the practice or resource links when they are available for this course.