---
title: "AP CSP Practice 2: Algorithms and Program Development"
description: "Learn AP Computer Science Principles Practice 2: how to represent algorithms without code and implement them, with exam tips and cross-unit examples."
canonical: "https://fiveable.me/ap-comp-sci-p/computational-thinking-practices/practice-2-algorithms-and-program-development/study-guide/yCIcMlA0naj9c7dn9YFm"
type: "study-guide"
subject: "AP Computer Science Principles"
unit: "Computational Thinking Practices"
lastUpdated: "2026-06-17"
---

# AP CSP Practice 2: Algorithms and Program Development

## Summary

Learn AP Computer Science Principles Practice 2: how to represent algorithms without code and implement them, with exam tips and cross-unit examples.

## Guide

## Overview

[AP Computer Science Principles](/ap-comp-sci-p "fv-autolink") Practice 2: Algorithms and Program Development is the computational thinking practice where you develop and implement [algorithms](/ap-comp-sci-p/key-terms/algorithm "fv-autolink"). In plain terms, you build step by step processes to solve problems and then turn those steps into working code or trace what they do. This practice has two skills: representing algorithms without a programming language (2.A) and implementing and applying an algorithm (2.B).

Both skills show up on the multiple-choice section and can appear in your Create written responses. If you can describe a process clearly in words or a flowchart and then carry it out correctly, you are doing Practice 2.

## What Practice 2: Algorithms and Program Development Means

An algorithm is a finite set of instructions that accomplishes a task. Practice 2 covers two related abilities:

- Describing the logic of an algorithm in a form anyone can read, like plain language steps, [pseudocode](/ap-comp-sci-p/key-terms/pseudocode "fv-autolink"), or a diagram (2.A).
- Putting that logic into action by building or running it, including in actual [program](/ap-comp-sci-p/unit-1/program-function-purpose/study-guide/8hL8KatG4rAWTwZSglGB "fv-autolink") code (2.B).

The course does not use one required programming language, so the exam uses a shared Exam Reference Sheet with block-based and text-based versions of common constructs. Practice 2 is about the thinking behind the steps, not memorizing one language.

## What This Practice Requires

You need to do two main things accurately.

**2.A: Represent algorithmic processes without using a programming language**

- Write or read step by step instructions in plain language or pseudocode.
- Use [sequencing](/ap-comp-sci-p/key-terms/sequencing "fv-autolink"), [selection](/ap-comp-sci-p/key-terms/selection "fv-autolink") (decisions), and iteration (repetition) correctly.
- Fill in missing steps so a described process works as intended.
- Recognize when a loop should stop and what [condition](/ap-comp-sci-p/key-terms/condition "fv-autolink") controls it.

**2.B: Implement and apply an algorithm**

- Carry out an algorithm and produce the correct result.
- Apply a known process, like adding 1 in [binary](/ap-comp-sci-p/unit-2/review/study-guide/YlNeQAM5snCDFEtp0CGd "fv-autolink") or moving a robot along a [path](/ap-comp-sci-p/unit-4/internet/study-guide/HouTEH6ypgVs8tNInelL "fv-autolink").
- Choose the [code segment](/ap-comp-sci-p/key-terms/code-segment "fv-autolink") that produces a required outcome.
- Combine constructs such as [conditionals](/ap-comp-sci-p/unit-3/conditionals/study-guide/JAgsZEPFqWJchRBqrX1O "fv-autolink") and loops to reach a goal.

## Skills You Need for This Practice

- **Sequencing:** Steps run in order, and order changes the result.
- **Selection:** Use IF and IF-ELSE logic to make decisions based on conditions.
- **Iteration:** Use loops and know the stopping condition, often something like "repeat until position is greater than n."
- **Tracing:** Walk through an algorithm with specific values to find the output.
- **[Variables](/ap-comp-sci-p/key-terms/variable "fv-autolink") and counters:** Track values like `count` and `position` as the algorithm runs.
- **[Pattern](/ap-comp-sci-p/unit-2/extracting-information-data/study-guide/EFuLgc6tL71cegDFjXRl "fv-autolink") recognition:** Spot when a process is a search, a count, or a transformation.

## How It Shows Up on the AP Exam

The end-of-course exam is 70 multiple-choice questions worth 70 percent, plus Create performance task written responses worth 30 percent. Practice 2 questions appear throughout the multiple-choice section, and [Big Idea 3: Algorithms and Programming](/ap-comp-sci-p/unit-3/review/study-guide/eOWMqAJUdtnmttaCSlis "fv-autolink") is weighted 30 to 35 percent, so this practice carries real weight.

Common formats you will see:

- **Fill in the missing steps.** A plain language algorithm is given with blanks, and you choose the steps that make it work. The right answer usually has the correct loop and the correct stopping condition.
- **Apply a process.** You execute a known operation, such as finding the next binary [number](/ap-comp-sci-p/unit-3/variables-assignments/study-guide/vtJhAf5XFOkm1uHNDMvh "fv-autolink") after 1001 0011, which is 1001 0100.
- **Pick the correct code segment.** You choose the segment that moves a robot along a marked path or draws a required figure.

Practical tip: when a question gives answer choices that differ only in the stopping condition, test each one with a small example to see which loop actually ends correctly.

## Examples Across the Course

Practice 2 connects to many units, not just one.

- **[Unit 2](/ap-comp-sci-p/unit-2 "fv-autolink"), [Binary Numbers](/ap-comp-sci-p/unit-2/binary-numbers/study-guide/k2SYC0VlP2hcRfVUC75l "fv-autolink"):** Implement the "add 1" algorithm in binary. If the last ID was 1001 0011, the next is 1001 0100. This is 2.B applied to data representation.
- **Unit 3, Iteration and [Lists](/ap-comp-sci-p/unit-3/lists/study-guide/mCE6meIGp5pqs1y5ym3h "fv-autolink"):** Represent a counting algorithm in plain language. To count [list](/ap-comp-sci-p/unit-3/data-abstraction/study-guide/kMMTClSiHohfiaHMGFFE "fv-autolink") elements greater than 100, you increase `position` by 1 and repeat the check until `position` is greater than `n`, then display `count`. This is 2.A.
- **Unit 3, [Developing Algorithms](/ap-comp-sci-p/unit-3/developing-algorithms/study-guide/eFTUAVlAEU4XUX3MeQmF "fv-autolink") with a robot:** Choose the code segment that moves a triangle robot to a gray square along arrows on a grid. Sequencing and turns must match the path exactly. This is 2.B.
- **Unit 3, Procedures and drawing:** Pick the loop that calls `drawCircle(x, y, r)` in the right order to produce a figure. Where you place the call inside the loop changes the output. This is 2.B.
- **Unit 4, Parallel and Distributed Computing:** Applying an algorithm shows up when you schedule processes across two processors to find the minimum total time, which reinforces step ordering and resource use.

## How to Practice Practice 2: Algorithms and Program Development

- **Write algorithms in plain language first.** Before coding, list the steps in words. This builds 2.A directly.
- **Trace with a table.** Make columns for each variable and update them line by line. This catches loop and counter errors.
- **Test the stopping condition.** For every loop, ask what makes it stop and run a tiny example to confirm.
- **Convert both directions.** Take a pseudocode description and write code for it, then take code and describe it in words.
- **Use the Exam Reference Sheet.** Practice reading both block and text versions so language differences do not slow you down.
- **Redo missed questions by re-tracing.** When you get one wrong, find the exact step where the output diverged.

## Common Mistakes

- **Wrong stopping condition.** Looping until `count` exceeds a value when you should loop until `position` exceeds `n`. The loop control variable must match what is changing.
- **Off by one errors.** Starting `position` at the wrong index or stopping one step too early or too late.
- **Order mistakes.** Placing a procedure call or an update in the wrong spot inside a loop, which shifts every result.
- **Forgetting to initialize.** Not setting a counter like `count` to 0 before the loop starts.
- **Skipping the trace.** Choosing an answer that looks right without testing it on a small example.
- **Confusing represent and implement.** 2.A is describing the steps, 2.B is carrying them out. Some questions test one, some test both.

## Quick Review

- Practice 2 has two skills: represent algorithms without code (2.A) and implement and apply algorithms (2.B).
- Algorithms use three building blocks: sequencing, selection, and iteration.
- Order matters, and the loop stopping condition is a frequent source of right and wrong answers.
- Initialize counters before loops and trace with a value table to check output.
- This practice spans units, including binary operations, list counting, robot movement, and procedure calls.
- On the exam, test answer choices with a small example, especially when they differ only in the loop condition.
