• 55 questions

AP Computer Science Principles Practice Test

An unofficial AP CSP practice test: multiple-choice concept and pseudocode questions on all five big ideas.

A program defines PROCEDURE double(n) { RETURN(n * 2) }. What does DISPLAY(double(double(3)) + 1) show?

Pick an answer, then press Check answer. Then you see Correct or Not quite, with the reason. Keys: A to D pick, Enter checks.

Print covers the next 35 questions. Share this set copies a link to the same questions in the same order.

Exam mode: 35 questions, 60 minutes.

More options

Unofficial practice questions, not affiliated with the College Board. Bank checked October 10, 2026.

All 55 questions

Big Idea 1: Creative Development 6

  • A program is meant to average three test scores but divides their sum by 2. It runs to the end and displays a wrong average. What kind of error is this? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 1.4 (CRD-2.I.1, CRD-2.I.2)
  • A program should accept ages from 0 to 120. Which set of test inputs follows the course framework's advice on choosing test values? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 1.4 (CRD-2.J.1, CRD-2.J.2)
  • A team builds a login screen and tests it until it works, then adds a search feature and tests that, one piece at a time. Which word describes this development process? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 1.3 (CRD-2.E.3, CRD-2.E.4)
  • In event-driven programming, what causes a block of program statements to run? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 1.2 (CRD-2.C.3, CRD-2.C.5)
  • Which statement about comments in program code is true? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 1.3 (CRD-2.G.2, CRD-2.G.5)
  • Why does a development team gather input from people with different backgrounds while it designs an app? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 1.1 (CRD-1.A.4, CRD-1.A.6)
Show all 55 questions (49 more)

Big Idea 2: Data 11

  • A dataset shows that towns with more bicycle shops also have more parks. What can be concluded from the data alone? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 2.3 (DAT-2.A.3)
  • A language stores each integer in a fixed number of bits. A sum comes out larger than the largest value those bits can hold. What kind of error can result? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 2.1 (DAT-1.B.1, CRD-2.I.4)
  • A photo file stores the date it was created and its file size alongside the image. What is this extra information called? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 2.3 (DAT-2.B.1)
  • A program adds two decimal fractions and the stored result is off by a tiny amount. What is the most likely cause? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 2.1 (DAT-1.B.3)
  • A recorder turns a sound wave into digital data by measuring the wave at regular intervals. What is each of these measurements called? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 2.1 (DAT-1.A.8, DAT-1.A.10)
  • An archive must shrink its scanned documents for storage but must be able to rebuild every original file exactly. Which kind of compression should it choose? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 2.2 (DAT-1.D.4, DAT-1.D.7)
  • The bits 11010 stand for which base 10 number? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 2.1 (DAT-1.C.2, DAT-1.C.3)
  • How many different values can be represented with 6 bits? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 2.1 (DAT-1.A.6, DAT-1.C.2)
  • In a survey dataset the same state appears as "NY", "New York" and "new york". Replacing all three with one spelling, without changing the meaning, is an example of AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 2.3 (DAT-2.C.4)
  • Lossy compression can usually shrink a file more than lossless compression can. What is the cost? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 2.2 (DAT-1.D.5, DAT-1.D.6)
  • Which binary number is equal to the decimal number 37? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 2.1 (DAT-1.C.2, DAT-1.C.3)

Big Idea 3: Algorithms and Programming 18

  • A binary search looks for one value in a sorted list of 1,000 items. What is the largest number of items it could need to examine? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.11 (AAP-2.P.1, AAP-2.P.3)
  • A program defines PROCEDURE double(n) { RETURN(n * 2) }. What does DISPLAY(double(double(3)) + 1) show? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.12 (AAP-3.A.4)
  • A program is about to run a binary search on a list of names. Which condition must the list meet first? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.11 (AAP-2.P.1, AAP-2.P.2)
  • A program runs nums ← [3, 6, 9], then APPEND(nums, 12), then REMOVE(nums, 1), then INSERT(nums, 2, 5). What does nums hold at the end? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.10 (AAP-2.N.1)
  • A program runs scores ← [70, 85, 90, 60]. In the notation of the exam reference sheet, what does DISPLAY(scores[2]) show? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.2 (AAP-1.D.8, AAP-2.N.1)
  • A program sets n ← 10 and count ← 0. A REPEAT UNTIL (n < 1) loop then runs two statements each time around: n ← n - 3, then count ← count + 1. What is the value of count when the loop stops? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.8 (AAP-2.K.3)
  • A program sets score ← 85 and then runs IF (score ≥ 90) { DISPLAY("A") } ELSE { IF (score ≥ 80) { DISPLAY("B") } ELSE { DISPLAY("C") } }. What is displayed? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.7 (AAP-2.H.3, AAP-2.I.1)
  • A program sets total ← 0 and then runs FOR EACH n IN [4, 7, 10] { total ← total + n }. What is total afterward? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.10 (AAP-2.O.2, AAP-2.O.3)
  • A program sets x ← 1 and then runs REPEAT 4 TIMES { x ← x * 2 }. What is the value of x afterward? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.8 (AAP-2.K.2)
  • For a list of n items, which algorithm counts as running in reasonable time? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.17 (AAP-4.A.7)
  • For which value of n is the expression (n > 3) AND (NOT (n > 8)) true? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.5 (AAP-2.F.2, AAP-2.F.3)
  • How many different results can RANDOM(3, 8) return? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.15 (AAP-3.E.1)
  • No known algorithm finds the best delivery route among 60 stops in a reasonable amount of time, so an app uses a method that finds a good route quickly without a guarantee that it is the best. What is such a method called? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.17 (AAP-4.A.8, AAP-4.A.9)
  • These statements run in order: a ← 4, then b ← a + 3, then a ← b * 2. What is the value of a at the end? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.1 (AAP-1.B.2, AAP-1.B.3)
  • These statements run in order: x ← 5, y ← 9, temp ← x, x ← y, y ← temp. What do x and y hold at the end? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.1 (AAP-1.B.2, AAP-1.B.3)
  • What does the expression 23 MOD 4 + 2 * 3 evaluate to? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.3 (AAP-2.C.3, AAP-2.C.4)
  • What is an undecidable problem? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.18 (AAP-4.B.2, AAP-4.B.3)
  • Which expression is true exactly when the whole number n is even? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 3.3 (AAP-2.C.2, AAP-2.C.3)

Big Idea 4: Computer Systems and Networks 7

  • A file sent over the internet is split into packets. Which statement about those packets is true? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 4.1 (CSN-1.C.2, CSN-1.C.3, CSN-1.B.5)
  • A task takes 60 seconds on one processor. In a parallel version, 20 seconds of the work must still run in sequence, and the rest is split evenly across 4 processors. What is the speedup? Worked from the statements in the question; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 4.3 (CSN-2.A.6, CSN-2.A.7)
  • How are the internet and the World Wide Web related? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 4.1 (CSN-1.D.1, CSN-1.D.2, CSN-1.D.3, CSN-1.B.1)
  • IPv4 addresses are 32 bits long and IPv6 addresses are 128 bits long. How many times as many addresses can IPv6 represent? Worked from the statements in the question; IETF RFC 791, "Internet Protocol", section 2.3 and IETF RFC 4291, "IP Version 6 Addressing Architecture", section 2, read October 10, 2026; AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 4.1 (CSN-1.C.4)
  • Thousands of home computers each analyze one slice of a huge dataset for the same research program. Which computational model is this? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 4.3 (CSN-2.A.1, CSN-2.A.3)
  • Two separate paths connect routers A and B. One cable is cut, and messages between them still get through. What is this property of the network called? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 4.2 (CSN-1.E.2, CSN-1.E.3, CSN-1.E.5)
  • Which internet protocol provides reliable, in-order delivery of a stream of bytes to an application? IETF RFC 9293, "Transmission Control Protocol (TCP)", section 2.2, read October 10, 2026; course topic 4.1 (CSN-1.C.4)

Big Idea 5: Impact of Computing 13

  • A malicious program attaches itself to a legitimate program, copies itself, and starts running on its own. What is it? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 5.6 (IOC-2.B.8, IOC-2.C.2)
  • A payment app opens only after its owner types a PIN and then scans a fingerprint. Which two categories of evidence does this login combine? NIST Computer Security Resource Center glossary, "multi-factor authentication", read October 10, 2026; course topic 5.6 (IOC-2.B.3)
  • A photographer wants anyone to be free to share, use and build on her photos without asking her each time. Which tool is made for this? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 5.5 (IOC-1.F.5)
  • A voice assistant was trained mostly on recordings of adults and often misunderstands children. Would training it on twice as many recordings from the same adults fix the problem? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 5.3 (DAT-2.C.5, IOC-1.D.1, IOC-1.D.2)
  • An email that appears to come from a bank asks the reader to confirm a password on a look-alike website. What is this technique called? NIST Computer Security Resource Center glossary, "phishing", read October 10, 2026; course topic 5.6 (IOC-2.C.1)
  • Ana wants to send Ben a message with public key encryption. Which key does Ana use to encrypt it? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 5.6 (IOC-2.B.5)
  • Bird watchers across a country log their sightings in an app on their own phones, and researchers use the records to study migration. What is this an example of? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 5.4 (IOC-1.E.2, IOC-1.E.3)
  • One website records a visitor's location, another sets cookies, and a third keeps a browsing history. Why is combining such records a privacy concern? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 5.6 (IOC-2.A.7)
  • Someone plugs an unapproved wireless access point into an office network, which gives outsiders a way in. What is this device called? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 5.6 (IOC-2.C.3, IOC-2.C.4)
  • Students in a rural county have no home broadband and cannot do online homework, while students in a nearby city can. What is this gap an example of? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 5.2 (IOC-1.C.1, IOC-1.C.2)
  • What do certificate authorities do? NIST Computer Security Resource Center glossary, "certification authority", read October 10, 2026; course topic 5.6 (IOC-2.B.6)
  • What does it mean for a program to be open source? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 5.5 (IOC-1.F.5, IOC-1.F.7)
  • Which statement about the effects of a computing innovation is accurate? AP Computer Science Principles Course and Exam Description, effective fall 2023, topic 5.1 (IOC-1.B.1, IOC-1.B.4)

How this list was compiled: Our own questions, written to the five big ideas of the College Board's AP Computer Science Principles Course and Exam Description, effective fall 2023, https://apcentral.collegeboard.org/media/pdf/ap-computer-science-principles-course-and-exam-description.pdf, and to the exam page https://apcentral.collegeboard.org/courses/ap-computer-science-principles/exam, both read 2026-10-10. Each fact was read on 2026-10-10 in the place named under its question: a numbered essential knowledge statement of the Course and Exam Description, an IETF RFC or the NIST Computer Security Resource Center glossary. Code is written in the text notation of the exam reference sheet (the appendix of the Course and Exam Description), and every code and arithmetic answer was recomputed from the statements in its question. Licence: Own work.

How it works

This AP Computer Science Principles practice test, on screen or printed, has 55 questions of our own, spread over the five big ideas in the exam's proportions. It is unofficial and not affiliated with or endorsed by the College Board.

Read the full guide

The real multiple-choice section

By the College Board's exam page, read October 10, 2026, the end-of-course exam asks 70 multiple-choice questions in 120 minutes. Exam mode is half that length: 35 questions in 60 minutes.

The five big ideas

Creative Development carries 10 to 13% of the section, Data 17 to 22%, Algorithms and Programming 30 to 35%, Computer Systems and Networks 11 to 15%, and Impact of Computing 21 to 26%. The bank holds 6, 11, 18, 7 and 13 questions.

Where the answers come from

Each explanation names the numbered statement of the Course and Exam Description it rests on, or an IETF or NIST page. Every code answer was recomputed from the statements in its question.

  • On the exam reference sheet a list starts at index 1, not 0. Check the index before you pick.
  • The real section also asks two-answer questions and draws some code as blocks or a robot grid. Here every question has one answer.

Questions and answers

Are AP Computer Science Principles practice tests like this one official?

No. Every question was written for this site from the College Board's published course framework. None repeats or rewords a real, released or sample exam question, and a result here does not forecast an AP score.

Is this AP CSP practice test multiple choice?

Yes: 55 questions, four choices each, one right. The Create performance task and its two written-response questions are not practiced on this page.

Is there an AP Computer Science Principles practice test PDF?

Yes, as a printout. Print the question sheet opens 35 questions from all five big ideas; add more, up to all 55, and tick With answer key. Save as PDF in the print window makes it an AP CSP practice test PDF.

Is this a free AP Computer Science Principles practice test?

Yes. The page is free, needs no account and keeps your answers on your own device.

What is on the AP Computer Science Principles exam?

Two parts. The multiple-choice section is 70% of the score. The Create performance task is 30%: a program, a video and a Personalized Project Reference made in at least 9 hours of class time, plus two written-response questions in a 60-minute part of the exam.