AP Computer Science Practice Test (Questions Answers): There are a total of 35 questions in multiple-choice. You can test your College Board’s Advanced Placement® Program (AP®) Computer Science Principles (CSP) exam test prep here. In addition, you can download printable PDF free.
The exam that follows has the same format as that used on the actual AP exam. There are two ways you may use it: 1. Use it as a diagnostic test before you start reviewing. Following the answer key is a diagnostic chart that relates each question to sections that you should review. 2. You can also use it as a practice exam when you have completed your review.
AP Computer Science Practice Test
Test Prep | AP Exam |
Subject | Computer Science Principles (CSP) |
Total Questions | 35 |
Questions Type | Sample Multiple-Choice |
Printable PDF | Coming soon |
Quiz-summary
0 of 35 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
Information
AP CSP Exam Practice Test 1
Total Questions: 35
Time Limit: 45 Minutes
Click on the “StartQuiz” Button to start the test
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Results
0 of 35 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Average score |
|
Your score |
|
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- Answered
- Review
-
Question 1 of 35
1. Question
1 pointsConsider the following code segment, which uses the variables a and c.
a ← 3
a ← a + 5
c ← 3
a ← c + a
DISPLAY(a)
DISPLAY(c)
What is displayed when running the code segment? -
Question 2 of 35
2. Question
1 pointsWhen writing a program, what is true about program documentation?
I. Program documentation is useful while writing the program.
II. Program documentation is useful after the program is written.
III. Program documentation is not useful when run speed is a factor. -
Question 3 of 35
3. Question
1 pointsWhat is true about high-level programming languages?
I. High-level languages are easier to debug and easier to code than machine code.
II. High-level languages contain the most abstractions.
III. High-level languages are translated to machine code when executed on a computer. -
Question 4 of 35
4. Question
1 pointsHardware is built using multiple levels of abstractions. A computer is an abstraction. By making a computer an abstraction, it hides the complexity of the computer components, allowing the programmer to focus on programming
Which of the following lists hardware in order from high- to low-level hardware abstraction?
-
Question 5 of 35
5. Question
1 pointsWhich of the following examples LEAST likely indicates a phishing attack?
-
Question 6 of 35
6. Question
1 pointsWith the lowering of the digital divide and more products using the internet, the world is running out of IP addresses. The current plan is to switch from IPv4, which holds 32 bits, to IPv6, which holds 128 bits. With the increase from 32 bits to 128 bits, what is the resulting increase in possible IP addresses?
962
-
Question 7 of 35
7. Question
1 pointsTo get their AP scores hours earlier, if not days earlier, than the scheduled release time, students will hide their IP address so they appear to be in a different time zone. What device can students use to hide their IP address?
-
Question 8 of 35
8. Question
1 pointsOne reason to use a hexadecimal number is because it takes up less space than the binary representation. Each hexadecimal digit can represent four binary numbers
Convert A7HEX to binary.
-
Question 9 of 35
9. Question
1 pointsA computer can use 6 bits to store non-negative numbers. Which of the following will NOT give an overflow error?
I. 64
II. 63
III. 54
IV. 89 -
Question 10 of 35
10. Question
1 pointsTwo computers calculate the same equation:
a ← 1/3A second computer calculates
b ← 1/3If (a ≠ b), what error has occurred?
-
Question 11 of 35
11. Question
1 points
What is displayed after executing the algorithm in the flowchart? -
Question 12 of 35
12. Question
1 pointsWhat does the above algorithm display?
-
Question 13 of 35
13. Question
1 pointsWhat error is displayed by the algorithm below?
a ← 8
b ← 5
c ← b – 3
d ← c – 2
DISPLAY(a)
DISPLAY(5/d) -
Question 14 of 35
14. Question
1 pointsWhich of the following is NOT true when executing an algorithm?
-
Question 15 of 35
15. Question
1 pointsThe following code segment is intended to swap the values of the variables Marshmallow and Chocolate. What can replace to complete the swapping of Marshmallow and Chocolate?
Marshmallow ← 3 Chocolate ← 15 GrahamCracker ← Marshmallow Marshmallow ← Chocolate <Missing Code>
-
Question 16 of 35
16. Question
1 pointsThe following question uses two robots in two grids of squares. The robots are represented by triangles pointing in their direction of movement.
When the robot on the left moves over a light gray square, it sends a message to the robot on the right, causing that robot to move forward.
Which of the following code segments will cause the robot on the right to reach the dark gray square?
-
Question 17 of 35
17. Question
1 pointsConstants are variables that are initialized at the beginning of a program and never change. Which of the following are good uses for a constant?
I. To represent the maximum number of people that are safely allowed into a movie theater
II. The score of a ongoing football game
III. The value of pi -
Question 18 of 35
18. Question
1 pointsWhat allows users to refer to websites by names, such as hamsterdance.com, instead of IP addresses?
-
Question 19 of 35
19. Question
1 pointsWhat is the minimum number of bytes needed to store the number 240?
-
Question 20 of 35
20. Question
1 pointsAt one of the lowest levels of abstraction, digital data is represented in binary that is a combination of digital zeros and ones.
The number “1001001” in binary is equivalent to what number when converted to base 10?
-
Question 21 of 35
21. Question
1 pointsUsing a binary search, how many iterations would it take to find the letter w?
str ← [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z] -
Question 22 of 35
22. Question
1 pointsUsing a linear search, how many iterations would it take to find the letter x?
str ← [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z] -
Question 23 of 35
23. Question
1 pointsWhich of the following statements could be used to describe the role of the Internet Engineering Task Force (IETF)?
I. Prevents copyrighted material from being illegally distributed
II. Develops standards and protocols for internet communication
III. Prevents malware from being distributed -
Question 24 of 35
24. Question
1 pointsSequencing, selection, and iteration are building blocks of algorithms. Which of the following is considered selection?
-
Question 25 of 35
25. Question
1 pointsIf your algorithm needs to search through a list of unsorted words, what type of search would you use?
-
Question 26 of 35
26. Question
1 pointsThe code segment below is a test program intended to diagnose the disease held by a young child based on a user’s entry of fatigue_present and has_cough.
IF fatigue_present AND has_cough
DISPLAY “Flu”
IF has_cough
DISPLAY “Cold”
DISPLAY “Healthy”If all variables have the value true, what is displayed as a result of running the segments as shown?
-
Question 27 of 35
27. Question
1 pointsWhich of the following trade-offs is TRUE when representing information as digital data?
I. There are trade-offs in using lossy and lossless compression techniques for storage and transmitting data.
II. Reading data and updating data have different storage requirements.
III. Lossy data compression reduces the number of bits stored or transmitted at the cost of being able to reconstruct only an approximation of the original. -
Question 28 of 35
28. Question
1 pointsColors can be represented by a hexadecimal number. It is made up of three two-digit hexadecimal numbers representing the red, green, and blue components. For example, a color with Red 1, Green 2, and Blue 3 would have the hexadecimal code #010203. Which of the following is the hexadecimal code for a color with Red 160, Green 80, and Blue 60?
-
Question 29 of 35
29. Question
1 pointsThis is a web of devices connected through the fault-tolerant redundant internet.
What is the minimum number of other devices that device C must connect with to communicate with E?
-
Question 30 of 35
30. Question
1 pointsThis is a web of devices connected through the internet
What is the minimum number of connections that must be broken or removed in the network so that computer G can no longer communicate with computer A? -
Question 31 of 35
31. Question
1 pointsThe following code segment is intended to create list3, which is initially empty. The algorithm uses an abstraction, isFound(list, number), which returns true if the number is found in the list. What is displayed after running the following algorithm?
-
Question 32 of 35
32. Question
1 pointsWhat is displayed after running the following algorithm?
-
Question 33 of 35
33. Question
1 pointsWhat is displayed after running the following algorithm?
-
Question 34 of 35
34. Question
1 pointsWhat is displayed after running the following algorithm?
-
Question 35 of 35
35. Question
1 pointsA smartphone stores the following data for each picture taken using the phone.
The location where the photo was taken
The number of photos taken
The date and time the photo was taken
The filename of the photo
Which of the following can be determined using the metadata described above?
I. How many photos were taken at Disney World
II. The name of the person who took the most recent photo
III. Whether people tend to take more photos on the weekend than during the week
See also
- AP CSP Exam 2022 Study Guide with Practice Test [UPDATED]
AP CSP Practice Test Questions Answers [PDF] - AP Computer Science Principles (CSP) Practice Test
- AP Computer Science Practice Test (Questions Answers)