Practice Test 1 - AP Computer Science Principles

20 questions. Answer them in any order, then submit to see your score and every explanation.

  1. Which of the following is an example of bias being embedded in the design of an algorithm itself, rather than in the data used to train it?
  2. Which of the following procedure calls will return the string "Eligible to drive"?
  3. A city wants to optimize its traffic light system by analyzing a year's worth of traffic data from thousands of sensors. The dataset is several terabytes in size. Why would a distributed computing model be more suitable for this task than a single high-performance computer?
  4. ### Introduction Computing bias means a computer system produces unfair results for some people because of choices made by humans. In facial recognition, bias appears when a tool matches faces more accurately for some groups than others. For example, a city uses facial recognition to help identify suspects from security footage, but community reviews show the system flags more false matches for Black women than for white men. ### How Bias Emerges Bias emerges when the data used to build a system does not represent the full public. If the training photos include many light-skinned faces and fewer dark-skinned faces, the system "learns" patterns that work better for the overrepresented group. Bias also appears when designers choose goals like speed or convenience without checking who is harmed by errors. ### Societal and Personal Impacts Misidentification can lead to stressful police stops, wrongful questioning, or even arrest. People may lose trust in public safety agencies and in technology more broadly. Even when a mistake is corrected, the individual may face reputational damage, missed work, and fear of future encounters. ### Mitigation Strategies To reduce bias, agencies and companies test accuracy across demographic groups, expand and balance the photo data, and set strict rules for when facial recognition may be used. Some require a trained human reviewer and additional evidence before action is taken. Others publish audits and allow independent experts to evaluate results. ### Conclusion Facial recognition can support investigations, but it also risks unequal harm when errors cluster on specific groups. Fairness improves when systems are evaluated openly, updated with representative data, and limited by clear policies. In the context of the passage, how does bias influence the outcome of facial recognition use?
  5. Read the passage. A regional bank improves organizational security by applying safe computing principles: least privilege, regular updates, and careful data handling. Least privilege means each worker receives only the access needed for their job. Privacy concerns include limiting who can view account numbers and contact details. Security concerns include stopping unauthorized transfers and keeping systems reliable. The bank encrypts stored data, meaning it is scrambled and unreadable without a key. It also encrypts data in transit, meaning information is protected while moving across networks. Employees complete training on phishing and social engineering, which is manipulation that pressures people into sharing secrets. A breach occurs when a manager approves an urgent request without verifying the sender. Attackers reroute payments, causing financial losses and customer distress. The bank reimburses customers, hires auditors, and reports the incident under breach notification rules (Federal Trade Commission [FTC], 2022). Ethical implications include balancing convenience with strong safeguards that prevent foreseeable harm. What is the purpose of least privilege in the passage?
  6. A data analyst uses a business intelligence program that presents data in an interactive dashboard. The analyst can apply different filters, change the type of chart, and focus on specific data categories, observing the results of each change immediately. This process best exemplifies which concept?
  7. An app-development team of five students builds a habit-tracking mobile app. Kiara leads design and creates a clickable prototype; Ben codes the login and data storage; Lien writes automated checks and manual test plans; Omar curates a shared library of icons and fonts; Sofia coordinates meetings and keeps notes. They use a project board to assign tasks, a shared drive for assets, and short voice calls to resolve questions quickly. A bug appears where the app logs users out unexpectedly. Lien posts, "It happens after I edit a habit twice," and Ben replies, "I'll reproduce it with your steps." Kiara adds, "I'll test the prototype flow to see where it feels confusing." When frustration rises, Sofia says, "No blame—let's isolate the trigger and document what we learn." They fix the issue, ship a stable beta, and classmates praise the clean interface. In the described project, what role did Lien play in the project's success?
  8. A program stores a fractional number like 2/32/3 using a fixed number of bits. Because 2/32/3 is a repeating decimal (0.666...), it is stored as an approximation. This type of inaccuracy is best described as which of the following?
  9. Based on the text, a subscription media service collects names, emails, and viewing histories. Safe computing principles include minimizing collected data, securing stored information, and respecting user consent. Privacy concerns center on viewing histories, because they reveal personal interests and habits. Security concerns include stopping unauthorized access and preventing data leaks. The service encrypts databases and limits access to a few administrators. Ethical implications include transparency, meaning clear communication about what data is collected and why. A breach occurs when an administrator account is compromised through phishing, and attackers copy the viewing-history table. Customers face embarrassment and targeted scams, and the company faces lawsuits and reputational damage after disclosure (NIST, 2020). What role does transparency play in enhancing cybersecurity according to the passage?
  10. A government agency proposes a system to track citizens' locations using their mobile phone data to monitor compliance with a public health order. While the stated goal is public safety, this raises a major ethical debate concerning...
  11. What happens to the length of a list when the INSERT operation is performed?
  12. What is displayed when the code segment is executed?
  13. What is displayed when the code segment is executed?
  14. A scientist has a large dataset of daily temperature readings from a weather station. The scientist wants to analyze only the days where the temperature exceeded 30 degrees Celsius. Which of the following data processing techniques is most appropriate for this task?
  15. Before analyzing a large dataset of survey responses, a data scientist uses a program to standardize all text entries for a country (e.g., changing 'USA', 'U.S.', and 'America' to 'United States'). Why is this data cleaning step crucial for gaining accurate insights?
  16. An email filter moves messages to spam if if (hasSpamKeywords OR NOT senderIsTrusted). Based on the algorithm described, what is the result of the boolean expression when senderIsTrusted is false?
  17. ## Crowdsourcing and Problem-Solving in Computing ### Definition and Core Idea Crowdsourcing is a problem-solving and production strategy in which an organization distributes a task to a large, often online, group of people and then aggregates their contributions. In computing, it functions as a socio-technical system: software platforms coordinate many small inputs into a usable output, such as bug fixes, documentation, or feature proposals. ### Scenario: Open Source Software Development In open source software development, crowdsourcing is embodied by communities that publicly collaborate on shared codebases. For example, the Linux kernel and Mozilla Firefox accept contributions from thousands of developers, testers, and technical writers. Platforms such as GitHub and GitLab provide infrastructure for issue tracking, version control, code review, and automated testing, allowing geographically distributed participants to work asynchronously. ### Benefits for Computing and Society Crowdsourcing can be: - Scalable: more participants can address more issues in parallel. - Diverse: contributors bring varied expertise, devices, languages, and use cases. - Cost-effective: organizations may reduce direct labor costs by leveraging volunteer or part-time effort. These advantages often accelerate iteration: a user reports a defect, another submits a patch, and maintainers merge it after review. ### Impact on Innovation Because many people can propose solutions, open source projects often explore alternative designs rapidly. The passage notes that innovation emerges not only from "breakthrough" features, but also from incremental improvements—performance tuning, security hardening, and accessibility enhancements. ### Drawbacks and Risks Crowdsourcing introduces challenges: - Quality control: not all contributions meet standards; maintainers must review and test. - Coordination overhead: merging changes can create conflicts and delays. - Ethical concerns: unpaid labor, unclear attribution, and unequal influence among contributors may create inequities. ### Real-World Outcomes Successful open source projects typically rely on governance—maintainer roles, contribution guidelines, and code-of-conduct policies—to balance openness with reliability. When governance is weak, projects can suffer from inconsistent quality, contributor burnout, or fragmented "forks" that split effort. How does the passage describe the role of crowdsourcing in innovation?
  18. A financial analyst is using a program to process a list of stock prices. The program iterates through the list and converts each price from US dollars to Euros by multiplying by the current exchange rate. This is an example of which data process?
  19. A class uses iterative binary search on sorted array [4, 9, 13, 18, 21, 27, 33, 39, 45, 52, 60] to locate target 45; midpoint is ⌊(low+high)/2⌋\lfloor(\text{low}+\text{high})/2\rfloor. Steps: low=0, high=10, mid=5 (27)<45 so low=6; next mid=⌊(6+10)/2⌋\lfloor(6+10)/2\rfloor=8 (45) found. Refer to the array provided above. During the binary search, what is the middle element for the second iteration?
  20. A problem is described as "a decision problem for which an algorithm can be constructed that always produces a correct yes-or-no answer for all possible inputs." What term does this definition describe?

Practice tests