Home › Educational › Advanced Placement (AP) › AP Computer Science Principles

AP Computer Science Principles practice questions and exam guide

150 multiple-choice questions and 200 flashcards, written to the College Board AP Computer Science Principles Course and Exam Description blueprint. Every question carries a full rationale.

Last reviewed 2026-10-26 · CoStudy · how we write and review questions

  • 350 total items
  • 150 multiple choice
  • 200 flashcards

Study AP Computer Science Principles in CoStudy →

About the AP Computer Science Principles exam

College Board AP Computer Science Principles Course and Exam Description — 5 Big Ideas: Creative Development; Data; Algorithms & Programming; Computing Systems & Networks; Impact of Computing

CoStudy's AP Computer Science Principles bank holds 350 items. Every multiple-choice question carries a written rationale explaining why the correct answer is correct and why each distractor is tempting but wrong.

Free AP Computer Science Principles practice questions

A sample of 12 multiple-choice questions from the bank, with the full rationale shown.

Parallel computing differs from sequential by:

  1. Using less hardware
  2. Running slower
  3. Executing multiple operations simultaneously on different processors/cores — can dramatically reduce runtime for parallelizable problems
  4. Using one core only

Answer: C — Executing multiple operations simultaneously on different processors/cores — can dramatically reduce runtime for parallelizable problems

Parallel: multiple cores, GPUs, distributed clusters. Sequential: one operation at a time. Not all problems parallelize well (Amdahl's law). Examples: image rendering, neural network training, scientific simulations, database queries. AP CSP tests speedup concept and limitations.

A developer adds detailed comments only after the program is complete. The MOST LIKELY downside of waiting is:

  1. The intent behind each design decision may be forgotten or misremembered, making comments less accurate
  2. The compiler will refuse to run any program with late comments
  3. The program's runtime performance will degrade noticeably
  4. Late comments cause syntax errors throughout the file

Answer: A — The intent behind each design decision may be forgotten or misremembered, making comments less accurate

A) Memory fades; comments written later are often less accurate. B/C/D) Comments do not affect parsing, runtime, or syntax.

Pseudocode: a ← TRUE; b ← FALSE; c ← (a AND b) OR (NOT b). What is c?

  1. TRUE
  2. FALSE
  3. Undefined
  4. Both TRUE and FALSE

Answer: A — TRUE

A) (TRUE AND FALSE) OR (NOT FALSE) = FALSE OR TRUE = TRUE. B) Misses NOT. C/D) Not options in Boolean logic.

An undecidable problem is one for which:

  1. A solution exists but uses unreasonable time
  2. Only quantum computers can find a solution
  3. The input must always be sorted
  4. No algorithm can be written that produces a correct yes/no answer for ALL possible inputs

Answer: D — No algorithm can be written that produces a correct yes/no answer for ALL possible inputs

D) Definition: no general decision algorithm exists. A) That's intractable but decidable. B/C) Off topic.

Machine learning models are trained by:

  1. Hard-coding rules
  2. Exposure to training data, adjusting internal parameters to minimize error on the training set — generalizing to unseen data with appropriate regularization
  3. Manual programming only
  4. Random luck

Answer: B — Exposure to training data, adjusting internal parameters to minimize error on the training set — generalizing to unseen data with appropriate regularization

ML paradigm: data + algorithm → model. Training: optimize parameters (gradient descent) to fit training data. Generalization: performance on UNSEEN data is what matters. Overfitting: model memorizes training data, fails on new data. Solutions: cross-validation, regularization, more data, simpler models.

A digital image is represented by:

  1. Vector graphics only
  2. A single number
  3. A grid of pixels, each storing color information (typically RGB values 0-255 for red, green, blue → 24-bit color)
  4. Sound waves

Answer: C — A grid of pixels, each storing color information (typically RGB values 0-255 for red, green, blue → 24-bit color)

Raster image = pixel grid. RGB: 256³ ≈ 16.7 million colors. File size ≈ width × height × 3 bytes (uncompressed). Vector graphics (SVG): mathematical descriptions of shapes (lines, curves) — scalable without quality loss. JPG/PNG = raster; SVG/AI = vector.

An algorithm's RUNTIME efficiency typically scales:

  1. Always linearly
  2. Constantly always
  3. Always exponentially
  4. Different ways depending on the algorithm — constant, logarithmic, linear, quadratic, exponential — characterized in 'Big-O' notation (AP CSP uses 'reasonable' vs 'unreasonable' time)

Answer: D — Different ways depending on the algorithm — constant, logarithmic, linear, quadratic, exponential — characterized in 'Big-O' notation (AP CSP uses 'reasonable' vs 'unreasonable' time)

AP CSP simplifies algorithmic complexity to 'reasonable time' (polynomial: linear, quadratic) vs 'unreasonable' (exponential — TSP brute force, password cracking). Many problems become infeasible quickly. Heuristic approaches (approximations, ML) used for intractable problems.

Linear search through an unsorted list of n elements has WORST-CASE time complexity:

  1. O(1)
  2. O(log n)
  3. O(n) — must check up to n elements
  4. O(n²)

Answer: C — O(n) — must check up to n elements

Linear (sequential) search: check each element in turn. Worst case: target at end or not present, examines all n items: O(n). Average: n/2 = O(n). Best case: target at start: O(1). Binary search on SORTED list: O(log n).

A phishing attack typically:

  1. Uses physical hardware to crack passwords
  2. Is malware that targets only servers
  3. Uses deceptive messages, emails, or websites to trick users into revealing credentials or installing malware
  4. Encrypts user data without consent

Answer: C — Uses deceptive messages, emails, or websites to trick users into revealing credentials or installing malware

C) Standard phishing definition. A/B/D) Other attack types.

HTTPS differs from HTTP in that HTTPS:

  1. Always loads pages from the local cache
  2. Sends data over a faster physical connection
  3. Replaces TCP with UDP
  4. Encrypts the connection between client and server using TLS, protecting confidentiality and integrity in transit

Answer: D — Encrypts the connection between client and server using TLS, protecting confidentiality and integrity in transit

D) HTTPS = HTTP over TLS. A/B/C) Each is unrelated to what HTTPS provides.

The decimal number 10 in binary is:

  1. 1010
  2. 1100
  3. 1001
  4. 1110

Answer: A — 1010

10 = 8 + 2 = 2³ + 2¹ = 1010₂. To convert decimal to binary: repeatedly divide by 2, collect remainders bottom-up. (B) 1100 = 12. (C) 1001 = 9. (D) 1110 = 14. AP CSP exam tests small-number conversions.

A 'list' or 'array' is a data structure that stores:

  1. Only a single value
  2. Only booleans
  3. Unrelated values randomly
  4. An ordered collection of items, accessed by index (typically zero-based) — supports operations like get, set, append, insert, remove

Answer: D — An ordered collection of items, accessed by index (typically zero-based) — supports operations like get, set, append, insert, remove

Arrays/lists: ordered collections. Indexed access O(1). Search O(n). Insertion at end O(1) amortized; insertion in middle O(n). Other data structures: hash maps (O(1) lookup by key), trees (O(log n) ops on balanced trees), graphs (relationship modeling).

AP Computer Science Principles flashcards

6 sample cards from the 200 in the bank.

What is machine learning?

Subset of AI: systems that learn from data rather than being explicitly programmed.

Difference between Internet and World Wide Web?

Internet: physical infrastructure of networks. WWW: collection of documents and resources accessed over the Internet (HTTP, websites).

What was a positive impact of GPS?

Navigation, emergency services, agriculture (precision farming), wildlife tracking, scientific research.

What is the development cycle in CS?

Investigate, design, prototype, test, refine, deploy. Iterative — feedback loops at each step.

What is assignment?

Setting a variable's value: x ← 5 (or x = 5 in many languages).

What is a sandbox in programming?

Isolated environment where code runs without affecting real systems. Used for testing untrusted code.

Practise the full AP Computer Science Principles bank

These samples are a small slice. The full bank runs flashcards, multiple choice and timed mock exams with per-chapter progress tracking, on the web and in the iOS app.

Open AP Computer Science Principles →

AP Computer Science Principles — frequently asked

What is the AP Computer Science Principles exam?

College Board AP Computer Science Principles Course and Exam Description — 5 Big Ideas: Creative Development; Data; Algorithms & Programming; Computing Systems & Networks; Impact of Computing

How is CoStudy’s AP Computer Science Principles bank organised?

It holds 350 items (150 multiple-choice, 200 flashcards). Free samples on this page include the full rationale, with no account.

Does CoStudy replace the College Board?

No. the College Board owns the outline, the badge, and the sitting rules. This is independent practice with written rationales. We do not sell live items and we do not guarantee a pass.

Where do AP Computer Science Principles fees, cut scores, and pass rates live?

On the College Board’s published pages — start at the AP Course and Exam Descriptions. This page quotes a number only when we retrieved it from an official URL, and otherwise says unverified. Prep blogs that tabulate every exam’s price are often stale.

Are these real AP Computer Science Principles exam questions?

No. CoStudy does not have live items. The samples below are original practice written to the published outline, with rationales. Anyone selling “real exam dumps” is describing something you should not buy.

Primary source

This bank is written against the College Board's published exam material. Check the AP Course and Exam Descriptions for the current outline, fees and eligibility rules — those change, and the certifying body is the only authority on them. CoStudy is not affiliated with the College Board.

Related study guides

Related subjects

Browse professional certification banks →