AP CSP Practice Exam 2
AP Computer Science Principles
Full Practice Exam — #2 — 2 Hours — 70 Questions
Choose Your Mode
Test Mode: Timed exam with submit button at the end
Exam Instructions
- This exam contains 70 questions: 60 single-answer (Questions 1–60) and 7 select-two (Questions 131–137).
- Before selecting an answer, predict what you think the answer is — then eliminate obviously wrong choices.
- Pay attention to highlighted key words: NOT, EXCEPT, ALWAYS, NEVER, BEST.
- For select-two questions, choose exactly two correct answers — both must be correct for credit.
- Points are not deducted for incorrect or unanswered questions.
- Click Submit Exam when finished to see your score and explanations.
- Click Show Answer on any question to see the correct answer and explanation.
📝 Looking for Written Response Questions?
This exam focuses on the 70 multiple-choice questions (MCQ). For the 2 written response questions that complete Practice Exam 2, visit:
Need 1-on-1 Help? Work with an Expert AP CSP Tutor
Tanner Crow has 11+ years of teaching experience with 1,845+ verified tutoring hours. His AP CSP students score 5s at 3.6× the national average (34.8% vs 9.6%).
$150/hour (single session) | $125/hour (5-session package)
Schedule Your SessionWhy B is correct: 11111111 in binary is 255. Adding 1 produces 100000000, which requires 9 bits. With only 8 bits available, the leading 1 is lost (overflow), and the result stored is 00000000 — a classic integer overflow/wraparound.
Why A is wrong: 100000000 cannot fit in 8 bits.
Why C is wrong: Most systems do not automatically reject overflow — they silently wrap.
Why D is wrong: The problem specifies binary (integer) storage, not floating-point.
nums. Assume nums is a non-empty list of integers.Why C is correct: This algorithm is functionally correct. Initializing
largest to nums[1] (the first element) is a valid approach. The FOR EACH loop then checks every element. If nums contains only negative integers, the first element becomes largest and larger (less-negative) elements will update it correctly via item > largest.Why A is wrong: A describes a minor inefficiency, not a flaw, and correctly notes the output is still correct — but the question asks about a flaw, and this is not one.
Why B is wrong:
> vs. makes no difference for finding a maximum — both preserve the correct largest value.Why D is wrong: With all-negative list like [-5, -3, -8],
largest starts as -5. -3 > -5 is true, so largest updates to -3. The algorithm works correctly.Why B is correct: AP CSP's Creative Development framework emphasizes investigating and reflecting on the needs of the end users before building. Interviewing users and observing current behavior is the “investigate” phase of the design process.
Why A is wrong: Alpha testing happens after building a product, not before design begins.
Why C is wrong: Iterative development describes the build-test-revise cycle, not the initial investigation phase.
Why D is wrong: Decomposition is about breaking a problem into parts for implementation, not gathering user requirements.
Why B is correct: Correlation does not imply causation. A strong positive correlation means the two variables tend to move together, but other confounding variables (ability, prior knowledge, course difficulty) could explain the relationship. The data alone cannot establish causation.
Why A is wrong: Claiming causation from correlation alone is a fundamental statistical error.
Why C is wrong: Even if the correlation is bidirectional, concluding “motivation” is the cause introduces an unmeasured variable not in the data.
Why D is wrong: A correlation, no matter how strong, cannot predict an individual's exact score — there is always variation around the trend line.
mystery(4) return?Why C is correct: When
mystery(4) is called, n = 4. The loop repeats 4 times, and each iteration adds n (which is 4) to result. So: 0 + 4 + 4 + 4 + 4 = 16. This is equivalent to n × n = 4 × 4 = 16.Why A is wrong: 4 would be the result if n were added only once.
Why B is wrong: 8 would be 4 + 4, i.e., only 2 iterations.
Why D is wrong: 10 = 1+2+3+4, which would be the triangular number — but this loop adds n each time, not the iteration counter.
Why B is correct: The Internet uses packet switching, where each packet can take any available route to reach the destination. If a node is down, packets are automatically rerouted. This redundancy and flexibility is what makes the Internet fault-tolerant.
Why A is wrong: Fixed bandwidth allocation describes a different, older model — not the Internet's design.
Why C is wrong: Circuit switching (used in traditional phone systems) establishes a dedicated path before transmission and cannot reroute dynamically.
Why D is wrong: Encryption provides confidentiality, not fault tolerance or rerouting capability.
Why B is correct: From the user's privacy perspective, the most significant concern is that detailed behavioral and location data could be shared with advertisers, data brokers, or governments without consent. This is a core AP CSP IOC concern: data collected for one purpose being used for another (secondary use).
Why A is wrong: Recommendation accuracy is a usability concern, not a privacy concern.
Why C is wrong: Storage capacity is an infrastructure concern for the company, not a user privacy concern.
Why D is wrong: Server downtime is a reliability concern, not a privacy concern.
Why B is correct:
num MOD 2 = 1 is true when num is odd (remainder 1 when divided by 2). Since the intent is to display even numbers, the condition should be num MOD 2 = 0 (remainder 0 when divided by 2).Why A is wrong: When
num reaches 11, the condition num > 10 is true and the loop exits. This correctly includes 10 in the iteration. The loop termination condition is not the problem.Why C is wrong: Starting at 2 would skip 1, but 1 is odd and would already be excluded by a corrected condition. Initializing at 1 is not the root error.
Why D is wrong: Incrementing by 2 would also work only if starting at an even number, but the single root error — the wrong MOD condition — must be fixed first.
Why B is correct: When OCR software misreads handwritten text, the resulting digital records contain wrong values — this is inaccurate data. It is present but incorrect, which is a distinct data quality issue from missing or incomplete data.
Why A is wrong: The scenario describes misread values, not missing entire entries.
Why C is wrong: Nothing in the scenario indicates duplication of records.
Why D is wrong: The records are digitized and presumably accessible; the problem is their accuracy, not their accessibility.
Why C is correct: The loop continues until
divisor > n. When divisor equals n, the check n MOD n = 0 is always true (any integer divides itself evenly), causing the procedure to return false for every prime number. The condition should be divisor > n / 2 or divisor * divisor > n to stop before testing n against itself.Why A is wrong: 0 and 1 are correctly not prime; the condition
n < 2 returning false is correct.Why B is wrong: Starting at 1 would make every number return false, since
n MOD 1 = 0 for all n. Starting at 2 is correct.Why D is wrong: After the loop exits without finding a divisor, returning true is correct — the number is prime.
Why B is correct: DNS is essentially the Internet's phone book. When you type example.com, DNS looks up the corresponding IP address (e.g., 93.184.216.34) so your browser knows where to send requests.
Why A is wrong: Encryption is handled by protocols like TLS/SSL, not DNS.
Why C is wrong: Packet routing is handled by routers using the IP protocol, not DNS.
Why D is wrong: Content delivery networks (CDNs) cache web pages for fast delivery; DNS is not a content cache.
Why A is correct: A false positive occurs when a system incorrectly classifies something as positive (harmful) when it is actually negative (safe). The algorithm flagged and removed a safe, beneficial health post — that is a false positive.
Why B is wrong: A false negative means something truly harmful was NOT flagged — the opposite of what happened here.
Why C is wrong: A true positive means something harmful was correctly identified as harmful. The public health post is not harmful.
Why D is wrong: A syntax error is a programming/code mistake, not a classification error. The algorithm ran but classified incorrectly.
scores contains [85, 92, 78, 90, 88]. Consider the following code segment:Why B is correct: total = 85+92+78+90+88 = 433. LENGTH(scores) = 5. avg = 433 / 5 = 86.6.
Why A is wrong: 85 is the first element, not the average.
Why C is wrong: 433 is the total sum before dividing.
Why D is wrong: 88 is the last element in the list, not the average.
Why B is correct: JPEG compression permanently discards image data (fine color differences) that are unlikely to be noticed by the human eye. The original data cannot be perfectly reconstructed — this is the defining characteristic of lossy compression.
Why A is wrong: Replacing repeated sequences with short codes and allowing full reconstruction is lossless compression (e.g., LZ77, Huffman coding).
Why C is wrong: ZIP archives use lossless compression — files are stored at original quality and fully restored when extracted.
Why D is wrong: Perfect restoration means lossless, not lossy.
Why B is correct: Binary search works by repeatedly comparing the target to the middle element of the remaining search range, then eliminating half the list. This only works if the list is sorted — otherwise, eliminating half the elements could discard the target. Linear search checks each element sequentially and works on unsorted lists.
Why A is wrong: There is no minimum size requirement. Binary search is more efficient on large lists, but it is not a correctness precondition.
Why C is wrong: Binary search works on any ordered data type (strings, floats, integers) as long as there is a consistent ordering relation.
Why D is wrong: Binary search works on one-dimensional lists; no two-dimensional structure is needed.
Why B is correct: Creative Commons licenses occupy a middle ground between full copyright (“all rights reserved”) and public domain (“no rights reserved”). Creators can choose specific permissions (e.g., attribution required, non-commercial only, no derivatives), enabling legal sharing and collaboration while retaining specified rights.
Why A is wrong: Creative Commons licenses do not eliminate copyright — they operate within copyright law and allow creators to retain specified rights.
Why C is wrong: CC licenses do not automatically generate revenue. Some allow commercial use, others do not, but none include payment mechanisms.
Why D is wrong: CC licenses are chosen by individual creators, not governments.
x after execution?Why B is correct: 10 MOD 3 = 1 (10 = 3×3 + 1). So the first condition
x MOD y = 1 is true. Therefore: x ← 10 + 3 = 13.Why A is wrong: 7 would result from x ← x - y = 10 - 3, which executes only in the ELSE branch (when MOD gives neither 1 nor 0).
Why C is wrong: 30 = 10 × 3 executes when MOD y = 0, but 10 MOD 3 0.
Why D is wrong: x = 10 would mean no branch executed, but the first condition is true.
Why C is correct: A man-in-the-middle (MITM) attack places an attacker between the user and the server, silently intercepting (and possibly modifying) communications. The user is unaware because the attacker relays data normally. HTTPS/TLS encryption is designed specifically to prevent MITM attacks.
Why A is wrong: DDoS attacks overwhelm servers with traffic; they do not involve reading private communications.
Why B is wrong: Phishing uses deceptive emails/websites to steal credentials — it doesn't involve monitoring live network traffic.
Why D is wrong: SQL injection targets database queries through web forms, not network traffic interception.
RANDOM(a, b) returns a random integer between a and b, inclusive. A programmer wants to simulate flipping a fair coin, where HEAD = 1 and TAIL = 0. Which code segment correctly simulates this?Why A is correct:
RANDOM(0, 1) returns either 0 or 1 with equal probability (50% each), perfectly simulating a fair coin where HEAD=1, TAIL=0.Why B is wrong:
RANDOM(1, 2) returns 1 or 2 — not 0 or 1 as required by the mapping.Why C is wrong:
RANDOM(0, 2) returns 0, 1, or 2 with equal probability (33.3% each). This gives three outcomes, not two — not a fair coin.Why D is wrong:
RANDOM(1, 10) MOD 2 produces 0 for even results (2,4,6,8,10 — five values) and 1 for odd results (1,3,5,7,9 — five values). This is 50/50, so it technically works, but option A is the simpler and most direct correct answer.Why B is correct: If blank values are treated as 0 in the sum, dividing by 1,000 (total records) rather than 950 (records with data) artificially lowers the average. The 50 missing rows contribute 0 to the numerator but add to the denominator, pulling the average downward. This is a common data quality error when handling missing values (null/blank handling).
Why A is wrong: Dividing by total records is only correct if all records have valid values. Missing data requires careful handling.
Why C is wrong: 1,000 rows is a reasonable dataset size; statistical validity is not the issue here.
Why D is wrong: Missing values are not counted twice — they are counted once (as 0) in the denominator but not added to the sum.
countAbove(lst, threshold) is intended to return the number of values in lst that are strictly greater than threshold. The following code contains a bug.countAbove([3, 5, 5, 7], 5), what does the buggy code return, and what should it return?Why A is correct: With
[3, 5, 5, 7] and threshold 5:• Buggy code uses
5: matches 5, 5, 7 → returns 3.• Correct code should use
> 5: matches only 7 → returns 1.Why B is wrong: If the bug gave 3 and the correct answer were 2, that would mean two values exceed 5 — but only 7 is strictly greater than 5.
Why C is wrong: The buggy code matches 5, 5, and 7 (three values 5), not two.
Why D is wrong: Three values cannot be strictly greater than 5 in this list; only 7 qualifies.
Why B is correct: Scalability means a system can grow (scale up) or shrink (scale down) its resources in response to demand. A cloud service experiencing a traffic spike can spin up additional servers; during low traffic, it can reduce resources to save cost. This flexibility is a core advantage of cloud computing.
Why A is wrong: Encryption is a security concern, not a scalability concern.
Why C is wrong: Data durability (protection against data loss) is a reliability/redundancy concern, separate from scalability.
Why D is wrong: User authentication is a security concern unrelated to scalability.
a and b?Why B is correct: A temporary variable is required to swap without losing data. Step-by-step: temp ← a (saves original a), a ← b (overwrites a with b's value), b ← temp (gives b the original value of a). This correctly swaps.
Why A is wrong: After
a ← b, a's original value is lost. Then b ← a simply copies b's value back to b — both variables end up holding b's original value.Why C is wrong: temp ← b saves b. Then a ← b (a gets b, original a is lost). Then b ← temp (b gets b again). Result: a = original b, b = original b. The original value of a is lost.
Why D is wrong:
temp is used without being defined, so b's new value is undefined.Why B is correct: The digital divide refers to inequality in access to technology based on factors like income, geography, education, age, or disability. Rural areas may lack broadband; low-income families may not afford devices; elderly populations may lack digital literacy.
Why A is wrong: Programming language barriers are a technical concern, not a digital divide.
Why C is wrong: Cross-platform compatibility is a technical issue, not a digital divide.
Why D is wrong: This is factually incorrect; rural areas typically have slower, less reliable Internet access.
transform([1, 4, 7, 8, 10]) return?Why B is correct: The procedure filters for even numbers (MOD 2 = 0), then doubles them. Even numbers: 4, 8, 10. Doubled: 4×2=8, 8×2=16, 10×2=20. Result: [8, 16, 20].
Why A is wrong: This would require doubling all numbers, not just even ones.
Why C is wrong: This is the even numbers without doubling.
Why D is wrong: These are odd numbers, which are filtered out.
Why B is correct: Grouping similar data points into clusters or categories is classification/clustering, a fundamental data analysis technique used in machine learning and pattern recognition.
Why A is wrong: Encryption secures data, doesn't find patterns.
Why C is wrong: Compression reduces file size.
Why D is wrong: Deletion removes data permanently.
target in list, or -1 if target is not found. The procedure contains a logic error.
Why B is correct: The index ← index + 1 statement is placed after the FOR EACH loop completes, not inside it. This means index is never incremented during iteration, so the procedure always checks if the first item matches (index=1) and returns either 1 (match) or -1 (no match), ignoring all other elements.
Why A is wrong: While zero-based indexing is common, the problem doesn't specify which convention to use. The logic error is the placement of the increment, not the starting value.
Why C is wrong: FOR EACH is appropriate for iterating through a list; the issue is the misplaced increment statement.
Why D is wrong: In AP CSP pseudocode, = is used for equality testing (context-dependent). This is not the error.
Why B is correct: Well-designed data validation systems reject invalid input and prompt the user to enter valid data. This prevents data quality issues and ensures constraints are enforced.
Why A is wrong: Automatically changing user input without notification can cause serious data integrity problems.
Why C is wrong: Database field constraints don't automatically expand; they are defined at schema design time.
Why D is wrong: Properly validated systems reject out-of-range input rather than silently wrapping.
II. The condition should use
n MOD 2 = 0 instead of n / 2 = 0.III. The code will always return "odd" for any positive integer input.
Why C is correct: II is true because even/odd should be tested with MOD. III is true because for n 2, n / 2 is never 0, so the IF is false and it always returns "odd". I is false.
Why B is correct: This is a false positive caused by weak context understanding.
Why B is correct: TCP provides reliable, ordered delivery with retransmission and error checking.
Why A is correct: z=1, x=3 (integer division), y=1 → displays 3, 1, 1.
Why B is correct: Testing throughout development catches functional errors before deployment.
Why C is correct: 2^8 per channel → 2^24 total = 16,777,216.
true if a list contains any duplicate values, and false otherwise:
Why A is correct: It compares each element to itself, so it returns true immediately.
Why B is correct: “Anonymous” data can often be re-identified when combined with other sources.
Why A is correct: It blocks inbound SSH attacks but allows legitimate outbound SSH from inside.
Why A is correct: Only 12 and 18 are > 10, so the count is 2.
A city government wants to analyze traffic patterns using data from traffic cameras. The raw data includes timestamps, vehicle types, and license plate numbers. Before releasing the data to researchers, the city removes all license plate numbers. Which statement is MOST accurate?
Why B is correct: Even without license plates, the combination of precise timestamps, vehicle types, and camera locations can be cross-referenced with other data (e.g., security footage, social media check-ins, public records) to re-identify specific individuals. This is a classic de-anonymization risk.
Why A is wrong: Removing one identifier does not guarantee full anonymization when other quasi-identifiers remain.
Why C is wrong: "Completely secure" is an overstatement; re-identification risks remain.
Why D is wrong: There is no universal law requiring preservation of all raw PII; in fact, privacy laws often encourage minimizing PII retention.
PROCEDURE reverseList(lst) {
reversed ← []
FOR EACH item IN lst {
INSERT(reversed, 1, item)
}
RETURN reversed
}
Assume INSERT(list, index, value) inserts value at position index in list, shifting existing elements to the right. Does this procedure correctly reverse the list?
Why C is correct: In AP CSP pseudocode, lists are 1-indexed. Inserting each element at position 1 places it at the front of the list. As each new element is inserted at the front, the order is reversed. For example: original [A, B, C] becomes reversed [C, B, A].
Why A is wrong: AP CSP uses 1-based indexing, so position 1 is the front.
Why B is wrong: Iterating backwards would work, but it's not required — the current approach also works.
Why D is wrong: Initializing to a copy of lst would create a duplicate, not a reversed list.
A job recruitment platform uses an algorithm to rank applicants based on rsum keywords and work history. An investigation reveals that the algorithm systematically ranks female applicants lower than male applicants with similar qualifications. This is MOST likely caused by:
Why B is correct: Machine learning algorithms learn patterns from training data. If historical hiring data reflects gender bias (e.g., more men were hired in the past), the algorithm will learn and perpetuate that bias. This is a widely documented problem in algorithmic hiring systems.
Why A is wrong: Systematic bias affecting one group consistently is not random chance — it indicates a pattern in the algorithm or data.
Why C is wrong: Computational resources affect speed and scale, not fairness or bias.
Why D is wrong: Encryption is a security concern; it doesn't cause algorithmic bias.
Why A is correct: Symmetric encryption uses the same key for both encryption and decryption (e.g., AES). This requires a secure method to share the key between parties beforehand.
Why B is wrong: This describes asymmetric (public-key) encryption, not symmetric.
Why C is wrong: Encryption always requires a key; keyless "scrambling" that anyone can reverse is not secure encryption.
Why D is wrong: This also describes asymmetric encryption, where the public key is shared but the private key is kept secret.
PROCEDURE mystery(n) {
IF (n 1) {
RETURN 1
} ELSE {
RETURN n * mystery(n - 1)
}
}
What does mystery(5) return?
Why D is correct: This is a recursive factorial function. mystery(5) = 5 × 4 × 3 × 2 × 1 = 120.
Why A is wrong: 5 would be the result if the function simply returned n.
Why B is wrong: 15 = 5+4+3+2+1 (sum), not factorial (product).
Why C is wrong: 25 = 5×5 (squaring), not factorial.
A development team is building a mobile app. They create a basic prototype, show it to potential users, collect feedback, and then revise the design before writing more code. This process is BEST described as:
Why B is correct: The scenario describes a cycle of prototyping → testing → feedback → revision — the essence of iterative/agile development.
Why A is wrong: Waterfall completes each phase once in sequence without iteration.
Why C is wrong: Top-down design is decomposition, not feedback/revision.
Why D is wrong: Debugging is fixing code errors; this is design iteration.
Why B is correct: Machine learning can process thousands of reviews quickly and classify sentiment using patterns in text.
Why A is wrong: Manual reading is too slow for 10,000 reviews.
Why C is wrong: 10 is far too small a sample.
Why D is wrong: Length doesn't reliably indicate sentiment.
PROCEDURE findMin(nums) {
min ← 0
FOR EACH n IN nums {
IF (n < min) {
min ← n
}
}
RETURN min
}
Which of the following BEST describes the error?
Why A is correct: Initializing min ← 0 makes n < min never true for positive integers, so it always returns 0.
Why B is wrong: n < min is correct for minimum (but initialization is wrong).
Why C is wrong: FOR EACH is fine for lists.
Why D is wrong: It fails for positive-only lists.
A country implements a national ID system that stores citizens' biometric data (fingerprints, facial recognition) in a centralized government database. Which of the following is a valid privacy concern with this system?
Why A is correct: Biometric data is permanent; if leaked, it can't be “reset” like a password.
Why B is wrong: No system is completely secure.
Why C is wrong: Storage cost is not the main privacy concern.
Why D is wrong: Accuracy varies; the bigger issue is surveillance/abuse risk.
A large online retailer experiences a sudden surge in traffic when a popular product goes on sale. The company's cloud infrastructure automatically allocates additional servers to handle the increased load, then reduces server capacity when traffic returns to normal. This is an example of:
Why B is correct: Auto-scaling increases/decreases resources based on demand.
Why A is wrong: Load balancing spreads traffic; it doesn't add/remove servers.
Why C is wrong: Redundancy is for failover, not demand spikes.
Why D is wrong: Caching speeds access, not capacity scaling.
words ← ["apple", "banana", "cherry", "date"]
result ← []
FOR EACH w IN words {
IF (LENGTH(w) > 5) {
APPEND(result, w)
}
}
DISPLAY(result)
What is displayed?
Why B is correct: Only "banana" and "cherry" have length > 5.
A database contains a table with 1 million rows. A data analyst wants to get a representative sample for analysis. Which sampling method is MOST likely to produce an unbiased sample?
Why B is correct: Equal-probability random sampling is the standard approach for unbiased sampling.
target appears in the list items. Which line contains an error?
1 count ← 0
2 FOR EACH item IN items
3 {
4 IF (item = target)
5 {
6 count ← count + item
7 }
8 }
9 RETURN count
Why C is correct: Counting occurrences requires adding 1 per match, not adding the item's value.
Open-source software licenses allow anyone to view, modify, and distribute the source code. Which of the following is a benefit of open-source software?
Why B is correct: Open code can be reviewed by many people, which can speed vulnerability discovery and patching.
Why B is correct: IP addresses identify devices so packets can be routed to the right destination.
A software team uses version control (e.g., Git) during development. Which of the following is a primary benefit of version control systems?
Why B is correct: VCS tracks changes, supports collaboration, and enables rollback.
A photo sharing app allows users to apply filters that adjust brightness, contrast, and color saturation. The app processes images using which type of data representation?
Why B is correct: Digital color images are typically stored as RGB channel values.
I. Linear search works on both sorted and unsorted lists.
II. Binary search requires the list to be sorted.
III. Binary search is always faster than linear search for all input sizes.
Why A is correct: I and II are true; III is false because for very small lists, linear can be faster due to lower overhead.
A city government deploys "smart" streetlights that use sensors and cameras to adjust brightness based on pedestrian and vehicle traffic. Footage from these cameras is stored and can be accessed by law enforcement. Which of the following is a valid concern about this technology?
Why B is correct: Camera networks can enable persistent tracking and surveillance, raising major privacy concerns.
Why A is correct: IPv6 provides a vastly larger address space to solve IPv4 exhaustion.
PROCEDURE combine(list1, list2) {
result ← []
FOR EACH item IN list1 {
APPEND(result, item)
}
FOR EACH item IN list2 {
APPEND(result, item)
}
RETURN result
}
What does combine([1, 2], [3, 4]) return?
Why A is correct: It appends all elements of list1, then all elements of list2.
A weather forecasting model uses historical data to predict future temperatures. The model consistently underestimates temperatures in urban areas compared to rural areas. This is MOST likely caused by:
Why B is correct: Systematic error in one category suggests bias/model mismatch (urban heat island not learned).
Select-Two Instructions
- Each question below has exactly two correct answers.
- You must select both correct answers to receive credit — partial credit is not awarded.
- Use the checkboxes to mark your two selections before submitting.
Why A is correct: Online education platforms have genuinely expanded access to quality education for people in remote areas, reducing geographic barriers that previously limited learning opportunities.
Why C is correct: Social media and online platforms have enabled new forms of civic participation, grassroots organizing, and direct communication with elected officials across geographic boundaries.
Why B is wrong: The Internet does not guarantee accuracy. It has dramatically increased the spread of misinformation and disinformation — there is no universal fact-checking mechanism.
Why D is wrong: The Internet has introduced entirely new categories of crime (phishing, ransomware, identity theft) and has not eliminated cybersecurity threats. Universal encryption does not exist.
Why A is correct: Initializes hasNegative to false, then sets it to true if any negative number is found. After checking all elements, returns the final state. This correctly identifies whether the list contains negatives.
Why B is correct: Uses early return optimization — as soon as a negative number is found, immediately returns true. If the loop completes without finding a negative, returns false. This is more efficient than A but functionally equivalent.
Why C is wrong: Initializes to true (incorrect starting assumption), then sets to false if any non-negative number is found. For a list like [-1, 5], this would return false because the 5 triggers the IF condition, even though -1 is present.
Why D is wrong: Counts negative numbers, then returns (count = 0), which returns true when count is zero (no negatives found). This is the opposite of what is asked — it returns true when there are NO negatives.
Why A is correct: Mass surveillance is a major privacy concern. When facial recognition is deployed in public spaces (airports, streets, stores), it enables persistent tracking of individuals' movements and associations without their knowledge or consent.
Why B is correct: Research has documented that many facial recognition systems exhibit algorithmic bias, with higher false positive rates for women and people of color. This can lead to wrongful arrests or discriminatory treatment, particularly when used by law enforcement.
Why C is wrong: This is a benefit of facial recognition, not a negative consequence. The question specifically asks for negatives.
Why D is wrong: This is also a benefit (from a business perspective), not a negative consequence.
Why A is correct: Packet switching breaks data (e.g., an email, web page, video) into small packets. Each packet is transmitted independently and reassembled at the destination using sequence numbers.
Why B is correct: Because packets are independent, they can take different routes based on current network conditions. If a router fails or a link is congested, packets are automatically rerouted. This redundancy makes the Internet fault-tolerant.
Why C is wrong: This describes circuit switching (used in traditional telephone networks), not packet switching. The Internet does not reserve dedicated circuits.
Why D is wrong: Packets can take different paths and may arrive out of order — the receiving system reassembles them using sequence numbers.
Why A is correct: Removing rows with missing data (listwise deletion) is a valid approach if the missing data is random and the remaining sample size is large enough for meaningful analysis. With 85% of data intact, this could work well.
Why B is correct: Imputation (replacing missing values with mean, median, or mode) is a standard statistical technique. Using the mean preserves the overall distribution and allows all rows to be kept in the analysis.
Why C is wrong: Assuming missing values are $0 is arbitrary and could severely bias results. Missing data does not necessarily mean "no purchase" — it could be a data entry error, system glitch, etc.
Why D is wrong: Using the maximum value is arbitrary and would inflate the dataset, creating false patterns. This is not a standard data cleaning technique.
Why A is correct: Uses FOR EACH to iterate through the list. num MOD 2 = 0 correctly identifies even numbers (remainder 0 when divided by 2). Adds them to sum.
Why B is correct: Uses a REPEAT UNTIL loop with manual index management. list[index] MOD 2 = 0 correctly identifies even numbers. Functionally equivalent to A, just using a different looping construct.
Why C is wrong: Uses num / 2 = 0, which tests if the quotient equals zero (only true for num = 0 in integer division), not if the number is even. Division and MOD are different operations.
Why D is wrong: Uses num MOD 2 = 1, which identifies odd numbers (remainder 1 when divided by 2), not even numbers. This sums odds instead of evens.
Why A is correct: Agile development is characterized by short iterations (typically 1–4 week sprints) with working software delivered at the end of each sprint. Frequent releases and continuous user feedback allow for rapid adaptation.
Why C is correct: Agile explicitly values "responding to change over following a plan" (from the Agile Manifesto). Requirements can evolve as user needs become clearer or market conditions change.
Why B is wrong: This describes waterfall development, which requires comprehensive upfront planning and discourages changes once development begins. Agile is the opposite approach.
Why D is wrong: Agile emphasizes continuous testing throughout development (test-driven development, continuous integration). Testing only at the end is a waterfall characteristic.
Stuck on Any Concepts? Get Expert Help
Work 1-on-1 with Tanner Crow, an experienced AP CSP teacher with proven results. His students consistently outperform national averages by 3–4x on the AP exam.
$150/hour (single session) | $125/hour (5-session package)
Book Your Tutoring SessionExam Complete!
Review your answers and explanations below. Correct answers are highlighted in green; incorrect selections in red.
Get in Touch
Whether you're a student, parent, or teacher — I'd love to hear from you.
Just want free AP CS resources?
Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.
Message Sent!
Thanks for reaching out. I'll get back to you within 24 hours.
Prefer email? Reach me directly at [email protected]