AP CSP Practice Test
30 questions across the five Big Ideas of AP Computer Science Principles, each one explained with its source. Pass with 24 right, the site's practice line, then see how the real exam is scored from 1 to 5.
- Questions
- 30
- To pass
- 24 right 80%
- Time limit
- None
- Sign-up
- Not needed
Questions
Question 1 of 30
Creative development
A team builds a program by writing one small piece, testing it until it works, and only then adding it to the rest of the program. Which kind of development process is this?
Show the answer
Right answer: B. An incremental development process
Incremental means one working piece at a time
Under CRD-2.E.4, an incremental process breaks the problem into smaller pieces and makes sure each piece works before adding it to the whole.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), CRD-2.E.4, p. 43.
Question 2 of 30
Creative development
A program runs from start to finish without crashing, but it displays 25 when the correct result is 52 because the programmer used the wrong operator in a formula. Which kind of error is this?
Show the answer
Right answer: D. A logic error
A logic error gives wrong results
CRD-2.I names four kinds of error. A logic error is a mistake in the algorithm or program that makes it behave incorrectly or unexpectedly, which fits a program that runs but gives a wrong result. A syntax error breaks the language rules, a run-time error occurs during execution, and an overflow error comes from a number outside the allowed range.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), CRD-2.I.1 to CRD-2.I.4, p. 46.
Question 3 of 30
Creative development
A programmer writes notes next to a procedure that explain what it does and how it was developed. What are these notes an example of?
Show the answer
Right answer: A. Program documentation
Comments are program documentation
CRD-2.G.1 says program documentation is a written description of the function of a code segment, event, procedure or program and how it was developed. CRD-2.G.2 says comments are a form of documentation written in the program itself.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), CRD-2.G.1 and CRD-2.G.2, p. 45.
Question 4 of 30
Data
A file is 3 bytes long. How many bits does it contain?
Show the answer
Right answer: C. 24 bits
A byte is 8 bits
DAT-1.A.4 states that a byte is 8 bits, so 3 bytes are 3 x 8 = 24 bits.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), DAT-1.A.4, p. 53.
Question 5 of 30
Data
What is the decimal value of the binary number 1011?
Show the answer
Right answer: A. 11
Add the place values 8, 2 and 1
DAT-1.C.4 says the position of a digit in the binary sequence determines its numeric value. Reading 1011 from the left, the places are 8, 4, 2 and 1. The 1s are in the 8, 2 and 1 places, so the value is 8 + 2 + 1 = 11.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), DAT-1.C.4 and DAT-1.C.5, p. 55.
Question 6 of 30
Data
Which description of a single bit is correct?
Show the answer
Right answer: B. A binary digit that is either 0 or 1
A bit is a binary digit
DAT-1.A.3 says bit is shorthand for binary digit and is either 0 or 1. DAT-1.A.4 adds that a byte is 8 bits, so a group of eight is a byte, not a bit.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), DAT-1.A.3 and DAT-1.A.4, p. 53.
Question 7 of 30
Data
A photo app must shrink image files in a way that lets it rebuild the exact original data later. Which kind of compression should it use?
Show the answer
Right answer: D. Lossless compression
Lossless keeps every bit of the original
DAT-1.D.4 says lossless algorithms can usually reduce the number of bits stored or transmitted while guaranteeing complete reconstruction of the original data. Lossy compression cannot guarantee this.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), DAT-1.D.4 and DAT-1.D.5, p. 56.
Question 8 of 30
Data
A school finds that students who eat breakfast tend to have higher test scores. What can be said from this correlation alone?
Show the answer
Right answer: C. More research is needed to know whether breakfast causes the higher scores
Correlation is not proof of cause
DAT-2.A.3 says a correlation found in data does not necessarily indicate a causal relationship, and that more research is needed to understand the exact nature of the relationship.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), DAT-2.A.3, p. 58.
Question 9 of 30
Data
A table has the same city entered as NYC, New York City and new york. Replacing all of them with one spelling so the data are uniform, without changing what they mean, is called what?
Show the answer
Right answer: A. Cleaning the data
Cleaning makes data uniform
DAT-2.C.4 defines cleaning data as a process that makes the data uniform without changing their meaning, for example by replacing equivalent abbreviations, spellings and capitalizations with the same word.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), DAT-2.C.4, p. 59.
Question 10 of 30
Algorithms and programming
What is displayed? x ← 5; y ← x + 3; x ← y * 2; DISPLAY(x + y)
Show the answer
Right answer: D. 24
Trace each assignment in order
x is 5, then y is 5 + 3 = 8, then x is 8 * 2 = 16. DISPLAY(x + y) shows 16 + 8 = 24. The arrow ← evaluates the right side and assigns the result to the variable on the left.
RuleAP Computer Science Principles Exam Reference Sheet (College Board, 2025), Assignment, p. 1
Question 11 of 30
Algorithms and programming
What is displayed by DISPLAY(38 MOD 7 + 2)?
Show the answer
Right answer: B. 5
MOD is the remainder of a division
38 MOD 7 evaluates to the remainder when 38 is divided by 7, which is 3, because 7 * 5 = 35. Then 3 + 2 = 5. MOD has the same precedence as * and /, so it is done before the addition.
RuleAP Computer Science Principles Exam Reference Sheet (College Board, 2025), Arithmetic Operators and Numeric Procedures, p. 1
Question 12 of 30
Algorithms and programming
What is displayed? nums ← [4, 8, 15, 16]; APPEND(nums, 23); REMOVE(nums, 2); DISPLAY(nums[2])
Show the answer
Right answer: C. 15
Lists start at index 1
APPEND puts 23 at the end, giving [4, 8, 15, 16, 23]. REMOVE(nums, 2) deletes the item at index 2, so the list is [4, 15, 16, 23]. The element at index 2 is now 15, because the first element is at index 1.
RuleAP Computer Science Principles Exam Reference Sheet (College Board, 2025), List Operations, pp. 3 to 4
Question 13 of 30
Algorithms and programming
What is displayed? scores ← [3, 6, 9, 12]; total ← 0; FOR EACH item IN scores { IF(item MOD 2 = 0) { total ← total + item } }; DISPLAY(total)
Show the answer
Right answer: A. 18
Only the even items are added
FOR EACH sets item to each element in order. item MOD 2 = 0 is true for 6 and 12, so total becomes 6 + 12 = 18. The odd items 3 and 9 are not added.
RuleAP Computer Science Principles Exam Reference Sheet (College Board, 2025), Selection, p. 2, and List Operations, p. 4
Question 14 of 30
Algorithms and programming
What is displayed? n ← 1; REPEAT UNTIL(n > 50) { n ← n * 3 }; DISPLAY(n)
Show the answer
Right answer: B. 81
The loop stops once the condition is true
n takes the values 1, 3, 9, 27 and 81. REPEAT UNTIL checks the condition before each pass: 27 > 50 is false, so the loop runs again and n becomes 81. Then 81 > 50 is true, the loop stops, and 81 is displayed.
RuleAP Computer Science Principles Exam Reference Sheet (College Board, 2025), Iteration, p. 3
Question 15 of 30
Algorithms and programming
PROCEDURE gap(a, b) { IF(a > b) { RETURN(a - b) } ELSE { RETURN(b - a) } }. What is displayed by DISPLAY(gap(4, 10) + gap(10, 4))?
Show the answer
Right answer: D. 12
Both calls return 6
gap(4, 10): 4 > 10 is false, so the ELSE part returns 10 - 4 = 6. gap(10, 4): 10 > 4 is true, so it returns 10 - 4 = 6. The sum is 12. RETURN ends the procedure at once and hands back a value.
RuleAP Computer Science Principles Exam Reference Sheet (College Board, 2025), Procedures and Procedure Calls, p. 5
Question 16 of 30
Algorithms and programming
A procedure is defined as PROCEDURE area(width, height). What are width and height called?
Show the answer
Right answer: A. Parameters
Parameters are the input variables
AAP-3.A.3 says parameters are input variables of a procedure, and arguments specify the values of the parameters when the procedure is called. In area(3, 4), 3 and 4 are the arguments.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), AAP-3.A.3, p. 91.
Question 17 of 30
Algorithms and programming
Which of these algorithms runs in an unreasonable amount of time as the input grows?
Show the answer
Right answer: C. One whose number of steps grows exponentially with the input size
Exponential growth is unreasonable
AAP-4.A.7 says algorithms with polynomial efficiency or slower (constant, linear, square, cube and so on) run in a reasonable amount of time. Exponential or factorial efficiencies are examples of an unreasonable amount of time.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), AAP-4.A.7, p. 102.
Question 18 of 30
Algorithms and programming
A problem for which no algorithm can be written that gives a correct answer for every possible input is called what?
Show the answer
Right answer: B. An undecidable problem
Undecidable means no algorithm solves all cases
AAP-4.B.2 says an undecidable problem is one for which no algorithm can be constructed that is always capable of providing a correct yes-or-no answer, and AAP-4.B.3 says no algorithm could solve all instances of it. An optimization problem, by contrast, looks for the best solution among many.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), AAP-4.B.2 and AAP-4.B.3, p. 103.
Question 19 of 30
Algorithms and programming
A program must find a value in a list whose items are in no particular order. Which search algorithm can it use?
Show the answer
Right answer: D. Linear search
Binary search needs sorted data
AAP-2.O.5 describes linear (sequential) search: it checks each element of a list, in order, until the value is found or every element has been checked. It works on any list. AAP-2.P.1 says binary search starts at the middle of a sorted data set, so it needs sorted data.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), AAP-2.O.5 and AAP-2.P.1, pp. 89 to 90.
Question 20 of 30
Computer systems and networks
Which statement best describes the Internet?
Show the answer
Right answer: A. A network of interconnected networks that use standardized, open communication protocols
The Internet is a network of networks
CSN-1.B.1 describes the Internet as a computer network consisting of interconnected networks that use standardized, open (nonproprietary) communication protocols.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), CSN-1.B.1, p. 110.
Question 21 of 30
Computer systems and networks
Network designers add extra connections and routers so that a message can still arrive if one path fails. What does this redundancy make the network?
Show the answer
Right answer: C. More fault-tolerant
Redundancy makes a system fault-tolerant
CSN-1.E.2 defines redundancy as the inclusion of extra components that can be used to mitigate failure of a system if other components fail. CSN-1.E.5 says a system that can support failures and still continue to function is called fault-tolerant.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), CSN-1.E.2 to CSN-1.E.5, p. 112.
Question 22 of 30
Computer systems and networks
Bandwidth is the maximum amount of data that can be sent in a network in a fixed amount of time. In which unit is it usually measured?
Show the answer
Right answer: B. Bits per second
Bandwidth is measured in bits per second
CSN-1.A.7 defines bandwidth as the maximum amount of data that can be sent in a fixed amount of time, and CSN-1.A.8 says it is usually measured in bits per second.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), CSN-1.A.7 and CSN-1.A.8, p. 110.
Question 23 of 30
Computer systems and networks
A task takes 60 seconds when done sequentially and 15 seconds when done in parallel. What is the speedup of the parallel solution?
Show the answer
Right answer: D. 4
Speedup is sequential time divided by parallel time
CSN-2.A.7 defines speedup as the time it took to complete the task sequentially divided by the time it took to complete it in parallel. Here it is 60 / 15 = 4.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), CSN-2.A.7, p. 115.
Question 24 of 30
Impact of computing
Some households in a rural area have no reliable Internet service, so their children cannot use online learning tools that other children use. Which term names this gap in access?
Show the answer
Right answer: C. The digital divide
The digital divide is unequal access
IOC-1.C.2 says the digital divide refers to differing access to computing devices and the Internet, and IOC-1.C.1 says Internet access varies between socioeconomic, geographic and demographic characteristics.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), IOC-1.C.1 and IOC-1.C.2, p. 123.
Question 25 of 30
Impact of computing
A city app asks thousands of residents to report potholes with a photo, and uses the reports to build a repair map. Which term describes this way of getting input?
Show the answer
Right answer: B. Crowdsourcing
Crowdsourcing gathers input from many people
IOC-1.E.4 defines crowdsourcing as the practice of obtaining input or information from a large number of people via the Internet.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), IOC-1.E.4, p. 125.
Question 26 of 30
Impact of computing
A photographer wants others to reuse a photo without asking each time, as long as they follow stated conditions. Which kind of license supports this?
Show the answer
Right answer: D. A Creative Commons license
Creative Commons widens legal reuse
IOC-1.F.7 says Creative Commons, open source and open access have enabled broad access to digital information. IOC-1.F.6 adds that material created by someone else should always be cited.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), IOC-1.F.6 and IOC-1.F.7, p. 127.
Question 27 of 30
Impact of computing
An email that looks like it is from a bank asks you to click a link and type your password. Which technique is it?
Show the answer
Right answer: A. Phishing
Phishing tricks you into giving information
IOC-2.C.1 says phishing is a technique that attempts to trick a user into providing personal information, which can then be used to access sensitive online resources.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), IOC-2.C.1, p. 131.
Question 28 of 30
Impact of computing
A website asks for a password and then for a one-time code from a phone app before it lets you in. Which security measure is this?
Show the answer
Right answer: B. Multifactor authentication
MFA needs more than one proof
IOC-2.B.3 describes multifactor authentication as a method of computer access control in which a user is granted access only after successfully presenting several separate pieces of evidence, such as a password plus a code.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), IOC-2.B.3, p. 130.
Question 29 of 30
Impact of computing
In public key encryption, which key does the receiver use to decrypt a message?
Show the answer
Right answer: D. The receiver's private key
The private key decrypts
IOC-2.B.5 says public key encryption pairs a public key for encryption with a private key for decryption, and the sender does not need the receiver's private key to encrypt a message. Symmetric key encryption uses one key for both.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), IOC-2.B.5, p. 130.
Question 30 of 30
Impact of computing
Data sent over a public network can be intercepted and changed. One way this happens is through a wireless access point that gives unauthorized access to secure networks. What is it called?
Show the answer
Right answer: C. A rogue access point
A rogue access point is an unauthorized one
IOC-2.C.3 says data sent over public networks can be intercepted, analyzed and modified, for example through a rogue access point. IOC-2.C.4 defines a rogue access point as a wireless access point that gives unauthorized access to secure networks.
RuleAP Computer Science Principles Course and Exam Description (Effective Fall 2023), IOC-2.C.3 and IOC-2.C.4, p. 131.
AP Computer Science Principles practice test
Your result
0of 30 right
By topic
- Creative development
- 3 to go
- Data
- 6 to go
- Algorithms and programming
- 10 to go
- Computer systems and networks
- 4 to go
- Impact of computing
- 7 to go
The ones you missed
Your answers stay in this browser. No account, nothing sent.
AP CSP practice test overview
This free AP CSP practice test, also searched as an AP Computer Science Principles practice exam or an APCSP practice test, has 30 multiple-choice questions with one right answer each. They follow the five Big Ideas of the course in about the same proportions as the College Board's exam weights: 3 on creative development, 6 on data, 10 on algorithms and programming, 4 on computer systems and networks, and 7 on the impact of computing. Questions that show code use the notation of the AP Exam Reference Sheet, such as ← for assignment, DISPLAY, REPEAT UNTIL and lists that start at index 1.
Every answer comes with a short explanation and its source: the learning objective or essential knowledge code and the PDF page in the College Board's AP Computer Science Principles Course and Exam Description, or the page of the Exam Reference Sheet. At the end, the score report shows how you did in each topic. If you are looking for an AP CSP practice exam, use it to find the Big Ideas you still need to review. Your answers stay in your browser, and there is nothing to sign up for.
The AP exam is scored from 1 to 5 and the College Board does not publish a fixed number of right answers needed for each score, so 24 of 30 (80%) is this site's own practice line, not an official score.
- Creative development
- 3 questions
- Data
- 6 questions
- Algorithms and programming
- 10 questions
- Computer systems and networks
- 4 questions
- Impact of computing
- 7 questions
- To pass
- 24 of 30, the site's practice line (80%)
How the AP Computer Science Principles exam works
The AP Computer Science Principles exam has two parts: an end-of-course exam and the Create performance task. The end-of-course exam is fully digital, in the College Board's Bluebook app. Its multiple-choice section has 70 questions and lasts 120 minutes: 57 single-select questions, 5 single-select questions with a reading passage about a computing innovation, and 8 multi-select questions, where you pick 2 answers. Each question has 4 answer options. The College Board does not say how many questions are unscored.
The end-of-course exam also has two written response questions, which take 60 minutes and ask about your own Create performance task, so the whole sitting is 3 hours. During the exam you get the Exam Reference Sheet, which shows both block-based and text-based programming constructs. Questions in Big Ideas 1, 2 and 3 can be written as algorithms without code or as code that uses the sheet. The exam covers the course as it stands now, and the College Board has announced a redesign of the course for the 2027-28 school year.
The College Board lists the end-of-course exam for Friday, May 14, 2027 (Session 1), and May 2027 is the next exam date it publishes for AP CSP. Your Create performance task must be submitted as final in the AP Digital Portfolio by 11:59 PM ET on April 30, 2027. The exam fee for 2027 is $99 in the U.S., U.S. territories, Canada and DoDEA schools and $129 elsewhere, and your school may charge more to cover proctoring and administration.
- Questions
- 70 multiple choice, plus 2 written response questions on your Create task
- Time
- 120 minutes for multiple choice, 60 minutes for written response
- Passing score
- Scored 1 to 5; no fixed raw pass mark is published
- Big Idea 1
- Creative Development, 10 to 13%
- Big Idea 2
- Data, 17 to 22%
- Big Idea 3
- Algorithms and Programming, 30 to 35%
- Big Idea 4
- Computer Systems and Networks, 11 to 15%
- Big Idea 5
- Impact of Computing, 21 to 26%
- Format
- Digital, in the Bluebook app, with the Exam Reference Sheet
- Cost
- $99 in the U.S., $129 outside the U.S.
How your AP CSP score is built
Your AP score comes from two sections. Section I, the multiple-choice questions, counts for 70% of the score. Section II counts for 30% and has two components: the Create performance task, where you build a program of your choice, record a video of it running and write a Personalized Project Reference, and the two written response questions about that program. You get at least 9 hours of class time for the Create task.
The multiple-choice section is scored by computer. The Create task and the written responses are scored by college faculty and experienced AP teachers at the AP Reading. The College Board weights the parts and combines them into a composite score, then converts it to a score from 1 to 5. AP exams are not graded on a curve. Each college decides which scores earn credit or placement, and many U.S. colleges grant credit for a 3 or higher.
- Section I
- 70 multiple-choice questions, 70% of the score
- Section II
- Create performance task and 2 written responses, 30% of the score
- Create task time
- At least 9 hours in class
- Written responses
- 4 prompts in 2 questions: program design, algorithm development, errors and testing, data and procedural abstraction
- Final score
- 1 to 5, from a composite of both sections
- Source
- AP Computer Science Principles Course and Exam Description (Effective Fall 2023), Exam Information; College Board AP CSP exam page, AP scores page and 2027 AP exam fees page
AP CSP FAQ
How many questions are on the AP CSP exam?
The multiple-choice section has 70 questions: 57 single-select, 5 single-select with a reading passage, and 8 multi-select. There are also 2 written response questions about your Create performance task. This practice test has 30 single-select questions, not 70, so you can finish it in one sitting.
What is the passing score on the AP CSP exam, and how many can you miss?
AP exams are scored from 1 to 5, and the College Board does not publish a fixed number of right answers for any score. Your score comes from a composite of the multiple-choice section and the Create task. Here, 24 of 30 (80%) is the site's own practice line, so you can miss 6.
Is the AP CSP exam hard, and how do I study?
The course and exam description lists every learning objective and its essential knowledge, so it shows what can be asked. Algorithms and Programming is the largest Big Idea at 30 to 35% of the multiple-choice section, so practice tracing code that uses the Exam Reference Sheet notation. Then review Data (17 to 22%) and Impact of Computing (21 to 26%), and use a practice test like this one to see which Big Ideas still need work.
Do I need to know a programming language for the AP CSP exam?
The exam gives you a reference sheet with both block-based and text-based constructs, so the questions do not depend on one language. For the Create performance task you write a program of your choice. Practice reading the sheet's notation: ← assigns a value, DISPLAY shows it, and the first item of a list is at index 1.
What is the Create performance task?
It is the 30% part of your AP score that you complete in class, with at least 9 hours given. You develop a program, record a video of it running and write a Personalized Project Reference. Then, on the end-of-course exam, you answer two written response questions about your own program, with your Personalized Project Reference in front of you.
When is the AP CSP exam, and is it online or at a test center?
The College Board lists the end-of-course exam for Friday, May 14, 2027 (Session 1). It is a fully digital exam in the Bluebook app. The pages this site read do not say where each student sits it, and schools submit exam fees for their students, so ask your school's AP coordinator about the room and start time.
How much does the AP CSP exam cost?
The 2027 AP exam fee is $99 in the U.S., U.S. territories, Canada and DoDEA schools, and $129 outside the U.S. A College Board fee reduction of $37 per exam is available if you have significant financial need. Your school may charge more to cover proctoring and administration, and you pay through your school, not on the College Board website.
What happens if you get a low score on AP CSP?
Each college decides which AP scores it accepts for credit or placement, and many U.S. colleges grant credit for a 3 or higher. The College Board pages this site read do not state a rule for taking the exam again, so ask your AP coordinator about retesting and about the late-testing schedule.
Does the College Board offer an official AP CSP practice exam?
Yes. The College Board points students to AP Classroom, where your teacher can assign topic questions, practice questions and AP Videos, and the course and exam description has its own sample questions. This site does not copy any of them. The questions here are new and written from the course framework.
Can I print this practice test as a PDF?
Yes. The Printable PDF button under the test prints all 30 questions as a blank worksheet and puts the answer key, with the source for each answer, on a separate page. In your browser's print window, choose Save as PDF to keep a copy.
Where do these questions come from?
Every question and right answer comes from the AP Computer Science Principles Course and Exam Description (Effective Fall 2023) or the AP Exam Reference Sheet, and each explanation names the objective or section and the page. The wrong choices are written for this practice test, and the questions are new, not copied from any exam, book or prep site. This site is not part of the College Board.