AP Courses AP Biology AP Biology Units AP Human Geography AP HUG Units AP Computer Science Principles AP CSP Units
Practice Daily Practice Practice by Course Practice by Topic Practice Tests
AP Exam Resources AP Exam Dates Registration Fees Scores & Credit What to Bring
Start Practicing → Login
AP Computer Science Principles · Unit 2

AP Computer Science Principles Unit 2: Data

Master AP CSP Unit 2: how computers store everything as bits and bytes, when to use lossless vs lossy compression, how metadata reveals hidden information, lists and traversal, and the privacy tradeoffs of big data. Includes 60 vocab flashcards, 50 progressive MCQs, and 3 written-response scenarios.

Updated April 30, 2026 • Reviewed by APScore5 Editorial Team

What is AP Computer Science Principles Unit 2?

AP Computer Science Principles Unit 2, Data, focuses on the core concepts students need for exam-style reasoning. This guide gives short explanations, diagnostic checks, and progressive practice so students can move from basic recall to application.

10-question diagnostic

Question 1 of 10Start

Big ideas in this unit

Bits, bytes, and binary

A bit is the smallest unit of digital information — a single 0 or 1. Eight bits make a byte, which is enough to represent one letter or 256 different values (0-255). All data is stored as bits, and AP questions often test conversion and overflow.

Lossless vs lossy compression

Lossless compression keeps every detail and reconstructs perfectly. Lossy compression discards some detail for much smaller files; AP prompts test choosing the right method and explaining tradeoffs.

Filtering, metadata, and information

Data is raw values, while information is what you learn after organizing and filtering. Metadata adds context like timestamps, authors, and locations that can change interpretation.

Lists and traversal

A list stores values in order and traversal visits each value, usually in a loop. AP CSP frequently asks students to trace list pseudocode and predict output.

Big data, machine learning, and privacy

Big data enables pattern detection and machine-learning predictions, but collecting it can create privacy risks. AP answers earn credit by naming both benefits and harms with specifics.

Bits, bytes, and binary conversion

Why binary? Computer circuits have two states (on/off), so binary maps directly to hardware. A bit is one 0/1 value; a byte is 8 bits and represents 256 values.

Binary place values: 1, 2, 4, 8, 16, 32, 64, 128. Convert binary to decimal by adding place values where bits are 1. Example: 1101 = 8 + 4 + 1 = 13.

Decimal to binary: subtract largest powers of 2 that fit. Example: 25 = 16 + 8 + 1, so 11001.

Overflow: with 8-bit unsigned storage, max is 255. Add 1 and it wraps to 0.

Common mistake: bits and bytes are different. 100 Mbps internet speed is 12.5 MB/s, not 100 MB/s.

Lossless vs lossy compression

Why compress? Smaller files transfer faster and use less storage. Compression trades storage, quality, and processing cost.

Lossless compression preserves every detail and reconstructs perfectly (ZIP, PNG, FLAC). Lossy compression removes some detail for larger size reduction (JPEG, MP3, H.264).

Run-length encoding (RLE) is lossless and works best for repeated values, like simple graphics.

Worked example: 10 MB to 1 MB is a 10:1 compression ratio (90% reduction).

Common mistake: lossy is not automatically bad. For photos and streaming, reasonable lossy settings are often the right choice.

Filtering, metadata, and extracting information

Data vs information: data is raw values; information is insight from filtering, sorting, and analysis.

Filtering narrows records to entries matching conditions. Cleaning removes duplicates, fixes formatting, and fills missing values.

Metadata is data about data (author, date, location, device). It can expose sensitive details and is often used in investigations.

Correlation vs causation: relationships in data do not always mean one variable causes another.

Common mistake: treating metadata as harmless. Metadata often reveals identity or location even when content seems private.

Lists and traversal

A list stores ordered values accessed by index. AP CSP pseudocode uses 1-indexing (first item is list[1]).

Core operations: access, assign, append, insert, remove, and length checks.

Traversal processes each element with loops for tasks like totals, max values, counts, and filtering.

Worked example: traversing [10,25,5,30,15] with a max-update loop returns 30.

Common mistake: mixing AP pseudocode indexing (1-based) with Python indexing (0-based).

Big data, machine learning, and privacy

Big data is described by volume, velocity, and variety. Sources include sensor streams, transactions, social media, and IoT devices.

Machine learning learns patterns from training data to make predictions. Biased training data produces biased outcomes.

Privacy risks include tracking, profiling, re-identification, and breaches. Data collection can help services while raising surveillance risk.

PII (personally identifiable information) includes names, addresses, SSNs, emails, and biometrics, and is protected by privacy laws.

Common mistake: calling big data only good or only bad. Strong AP answers compare concrete benefits and concrete risks.

AP CSP Unit 2 flashcards

Every 5th card shows an ad placeholder with a 3-second delay before next card.

Card 1 of 60Tap card to flip

AP CSP Unit 2 practice questions (MCQ)

50 questions with rising difficulty and live scoring.

0Correct
0Answered
0%Accuracy
StartStatus
Question 1 of 50Start

Practice AP CSP-Style Written Responses (Unit 2)

Scenario 1: Compression choice with reasoning

A startup stores 10 million user photos and must choose PNG or JPEG. Identify the likely choice, one accepted tradeoff, and what changes if the files are medical X-rays.

Scenario 2: Metadata privacy analysis

A user posts a public party photo with EXIF GPS, timestamp, and device metadata. Identify three exposed details, one possible harm, and two concrete protection steps.

Scenario 3: Big data and bias

A predictive-policing system increases patrols in already heavily patrolled neighborhoods. Identify the bias, explain the feedback loop, and propose two fixes.

Why this matters

AP responses earn more points when they identify evidence, explain mechanism, and justify claims using precise Unit 2 vocabulary.

5–10 minute daily study loop

Day 1

Review core terms from the first two sections.

Day 2

Answer 10 questions and review explanations.

Day 3

Revisit missed items and explain each correction.

Day 4

Mix flashcards and practice for retention.

Day 5

Run a timed mini-set and check accuracy.

Day 6-7

Repeat weak-topic practice before next unit.

Save your progress

Create a free account to keep your score history and practice streak.

AP CSP Unit 1-2 cumulative review

Build cumulative accuracy by mixing Unit 1-2 concepts each day instead of reviewing one section in isolation.

Frequently asked questions

Is there an AP CSP Unit 2 Quizlet, study guide, or test PDF?

The 60 vocab flashcards, 50 MCQs, and 3 written-response scenarios on this page work as a complete study guide and practice test in one place - covering binary conversion, compression, metadata, lists and traversal, and big data privacy.

How do I get AP CSP Unit 2 test answers?

Official AP exam questions are secure, but the 50 practice MCQs on this page mirror the AP CSP Unit 2 progress check format with full answer explanations for every question.

What's the best way to review AP CSP Unit 2?

Use cumulative practice. Start with the diagnostic, master binary conversion, work through flashcards by section, then run the MCQ set in order. Mix in 5-10 questions from Unit 1 each session.

How hard is the AP CSP Unit 2 MCQ?

Unit 2 has more calculation than Unit 1 - binary conversion, compression ratios, and list pseudocode all require careful work. The MCQ set on this page builds from recall to multi-step reasoning.

Where can I find an AP CSP Unit 2 study guide?

Use the section explanations, vocabulary flashcards, and practice questions on this page as a complete AP CSP Unit 2 study guide. Each section connects key terms to what AP prompts test: identify, explain, apply, and compare.

Continue learning

Next: start AP Computer Science Principles Unit 3

Keep your momentum. Continue directly into Unit 3 so your review stays connected across concepts and exam skills.

Start Free Practice & Track Progress →
Unit progress0%