AP Computer Science Principles Unit 2 practice questions
Try 10 multiple-choice questions from Unit 2 here. Pick an answer to see why it's right or wrong, then take the timed test above for a full AP-style set.
Question 1
A company develops an automated hiring tool trained on resumes from its current employees, who are predominantly male. Which of the following describes the most likely negative impact of using this tool to screen future applicants?
The tool may unfairly penalize female applicants because the training data reflects existing gender imbalances.
The tool may unfairly penalize female applicants because the training data lacks sufficient volume to identify meaningful patterns.
The tool may unfairly penalize female applicants because the training data was not cleaned to remove duplicate or contradictory entries.
The tool may unfairly penalize female applicants because the training data combines multiple sources with different collection methods and standards.
Show answer
Answer: (A)
Connecting the source of training data to the output reveals that bias in the input (predominantly male resumes) leads to bias in the algorithm's decisions.
Question 2
A global weather monitoring system aggregates temperature readings from thousands of different sensor types, each using different file formats and units of measurement. What is the primary data processing challenge this system faces before it can generate accurate climate models?
The system must clean the data to standardize the inconsistent formats without changing the meaning.
The system must clean the data to encrypt the sensitive values without changing the meaning.
The system must clean the data to compress the large files without changing the meaning.
The system must clean the data to backup the original records without changing the meaning.
Show answer
Answer: (A)
Recognizing that data from multiple sources is often non-uniform allows for the identification of data cleaning as the necessary process to standardize formats for analysis.
Question 3
A video streaming service experiences a sudden surge in new subscribers, causing the recommendation engine to lag significantly and fail to update user preferences. Which of the following best describes the cause of this performance issue?
The system lacks scalability, preventing it from efficiently processing the increased volume of user data.
The system lacks encryption, preventing it from efficiently securing the increased volume of user data.
The system lacks redundancy, preventing it from efficiently backing up the increased volume of user data.
The system lacks portability, preventing it from efficiently transferring the increased volume of user data.
Show answer
Answer: (A)
Linking the surge in users to the system lag highlights scalability as the capacity of a system to adapt as the amount of data processing increases.
Question 4
A city government launches a mobile app allowing residents to report infrastructure problems like potholes. The data collected is used to prioritize repairs. Which of the following best describes a potential unintended consequence of this innovation?
Repair schedules may favor wealthier areas because the data reflects only residents with access to mobile devices.
Repair schedules may favor wealthier areas because the data reflects only residents with smartphone literacy skills.
Repair schedules may favor wealthier areas because the data reflects only residents who actively use social media platforms.
Repair schedules may favor wealthier areas because the data reflects only residents who have previously reported infrastructure problems.
Show answer
Answer: (A)
Evaluating the data collection method reveals that relying on a mobile app introduces socioeconomic bias, as only those with smartphones can contribute data.
Question 5
A variable
deviceIDuses a 5-bit binary sequence to store unique identifiers for sensors on a network. To generalize the system to support 60 unique devices, which change to the variable's representation is required?Increase to 6 bits to support 64 unique values
Increase to 7 bits to support 128 unique values
Increase to 8 bits to support 256 unique values
Maintain 5 bits to support 32 unique values
Show answer
Answer: (A)
Calculating the capacity of binary sequences () determines that 6 bits provide 64 unique combinations (), which is the minimum needed to cover 60 devices.
Question 6
A variable
limitis set to decimal 50. A sensor variablereadingupdates with binary values. Which binaryreadingvalue causes the conditionreading > limitto be true?00110011, representing decimal value 51
00110001, representing decimal value 49
00110010, representing decimal value 50
00101111, representing decimal value 47
Show answer
Answer: (A)
Converting the binary value () results in decimal 51, which is the only option strictly greater than the threshold of 50.
Question 7
A variable
codeaccepts data from two sources. Source A sends binary101010and Source B sends decimal 42. Which statement correctly compares the values stored in the variable?Both are equal because 101010 equals decimal 42
Source A is larger because 101010 equals decimal 52
Source B is larger because 101010 equals decimal 21
Source A is larger because 101010 equals decimal 84
Show answer
Answer: (A)
Converting the binary sequence () confirms it equals decimal 42, meaning both sources provide identical values.
Question 8
A variable
settingsstores the binary value11001100to represent active server clusters. If the system generalizes this data for a decimal display, what value is output?204, calculated by summing 128, 64, 8, and 4
200, calculated by summing 128, 64, and 8
192, calculated by summing 128 and 64 only
240, calculated by summing 128, 64, 32, and 16
Show answer
Answer: (A)
Summing the active bit positions () correctly converts the binary sequence to its decimal equivalent of 204.
Question 9
A programmer merges two lists of user IDs, group1 and group2, ensuring no duplicates appear in the final list. The code segment is:
group1 = ["A", "B"] group2 = ["B", "C"] final = [] FOR EACH g IN group1 APPEND(final, g) FOR EACH g IN group2 IF NOT (g IN final) APPEND(final, g)
What is the content of the list final after the code executes?
["A", "B", "C"], containing all unique items
["A", "B", "B", "C"], containing all items
["B"], containing only the shared items
["A", "C"], containing only unique items
Show answer
Answer: (A)
Tracing the execution shows that "A" and "B" are added first. When processing group2, "B" is skipped because it is already in the list, and "C" is added. This results in a union of the two lists without duplicates.
Question 10
A developer is creating a music streaming service and wants to balance audio quality with data usage. Which factor is most important to investigate to determine the trade-off between file size and sound fidelity?
The sampling rate and bit depth required for the audio
The programming language used to build the application
The color scheme used for the application interface
The brand of headphones most users will likely own
Show answer
Answer: (A)
Investigating sampling rate and bit depth allows the developer to calculate the exact bits needed per second, directly determining the trade-off between audio quality (fidelity) and file size.
What's on the AP Computer Science Principles Unit 2 practice test
The standard version takes about 34 minutes and follows the timing and directions of the AP exam, sized to one unit:
- 20 Multiple Choice Questions (34 minutes)
Questions are drawn from 820 multiple-choice questions written for Unit 2, Data.
Review Unit 2 before you start
- 2.1 Binary Numbers
- 2.2 Data Compression
- 2.3 Extracting Information from Data
- 2.4 Using Programs with Data
- Big Idea 2 Overview: Data