Practice Test 3 - AP Computer Science Principles

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

  1. A wearable device collects numerical heart rate readings and step counts throughout the day and stores them in a user history. A health app computes hourly averages, flags unusually high heart rates during rest, and summarizes activity trends. It then sends feedback like "take a break" or "increase activity" based on those summaries. In the described system, which part of the program's process directly influences the outcome?
  2. When a computer sends a message to another computer over the Internet, which of the following is a possible outcome regarding the arrival of the message's packets?
  3. Case study (Smart Devices): A suburban family installs a smart home system: a thermostat that learns schedules, smart speakers that respond to voice commands, and connected door locks and cameras controlled by a phone app. These devices rely on sensors, wireless networking, and cloud services that process voice recordings and video clips. The thermostat uses past temperature adjustments to predict comfort preferences, and the family receives monthly energy reports. Industry surveys frequently estimate tens of billions of connected "Internet of Things" devices worldwide, indicating widespread adoption. Benefits: The family lowers energy use by automatically reducing heating when no one is home. The door camera helps deter package theft, and elderly grandparents use voice reminders for medication. Remote control features increase convenience, especially when traveling. Harms: The same connectivity introduces security and privacy concerns. A weak reused password allows an attacker to access the camera feed, and the family worries about who can hear stored voice recordings. A service outage temporarily disables app-based door controls, forcing the family to use physical keys. The devices also generate detailed behavioral data—when people come home, what rooms they use—which could be misused if shared with third parties. In what ways does smart home technology improve and challenge societal norms as mentioned in the passage?
  4. A developer is creating a new educational app for elementary school students. To ensure the app is engaging and easy for young children to use, which of the following investigation methods would be most effective for gathering initial design requirements?
  5. A weather alert algorithm sends a heat warning if if (tempHigh AND NOT precipitationExpected). In the given programming task, which condition must be true for a heat warning to occur in this algorithm?
  6. The student's testing process demonstrates an understanding of which important aspect of program design?
  7. A program that calculates compound interest produces slightly incorrect results due to rounding errors in floating-point arithmetic. What type of error is this and what is the most appropriate approach to address it?
  8. Read the passage. A university uses organizational security to protect student records and research data. Administrators explain that strong password practices include long passphrases, unique passwords per site, and avoiding predictable patterns. They recommend a password manager, which securely stores many passwords in one encrypted vault. Privacy concerns include leaked grades and addresses, while security concerns include credential stuffing, where attackers reuse stolen passwords across services. The university adds two-factor authentication, requiring a password plus a temporary code, and trains staff to recognize phishing. The passage describes a breach where reused passwords allow attackers to access email accounts, leading to fraudulent refund requests and costly investigations (NIST, 2020). What is the purpose of using unique passwords per site in the passage?
  9. An educational software group builds a remote-learning platform for middle school courses. They add a program called LessonLoop that presents short interactive lessons, then offers practice questions that adapt to student responses. After each activity, LessonLoop records simple progress markers such as time spent, attempts, and which concepts caused confusion. It uses those markers to recommend review or enrichment the next day, aiming to keep students motivated without overwhelming them. Teachers want clear summaries for planning, students want lessons that feel achievable, and families want evidence of steady growth. School leaders also want the program to support large classes without slowing down. According to the text, What purpose does the program serve in its context of use?
  10. In which scenario would using a list be most beneficial compared to using individual variables?
  11. A sequential solution to a problem takes 600 seconds. A parallel solution using some number of processors takes 150 seconds. Which of the following statements is true?
  12. In some crowdsourcing systems, such as those used for image tagging, the same task is assigned to several different workers independently. The final accepted answer is often the one submitted by the majority. What is the primary purpose of this redundant approach?
  13. A programmer creates a function to search for a specific value in a sorted list using binary search. The function sometimes returns the correct index and sometimes returns -1 even when the value exists in the list. What is the best approach to debug this inconsistent behavior?
  14. Consider the following code segment: fruits ← ["apple", "banana"] APPEND(fruits, "cherry") INSERT(fruits, 2, "orange") What is the final order of elements in the fruits list?
  15. Which of the following is the defining characteristic of an undecidable problem in computer science?
  16. When a development team transitions from having programmers work individually to a pair programming model, which of the following trade-offs is most likely to occur?
  17. Based on the scenario, a library system processes a large list of book records books, where each record has fields title (string) and checkedOut (Boolean). Input: list books. Output: list of titles for books that are not checked out, in the same order they appear. Constraints: nn can be up to 100,000; do not modify the original books list; use AP-style pseudocode. A student writes: PROCEDURE AvailableTitles(books) titles <- [] FOR EACH book IN books IF book.checkedOut = TRUE APPEND(titles, book.title) RETURN titles Which step is necessary to ensure the procedure works correctly?
  18. Given the conditions in the pseudo-code, what will the output be if timeOfDay="day", traffic="high", hasPedestrian=true? // Inputs: timeOfDay, traffic, hasPedestrian IF timeOfDay == "night" PRINT "FLASHING" ELSE IF traffic == "high" PRINT "GREEN" ELSE IF hasPedestrian PRINT "WALK" ELSE PRINT "RED"
  19. A sensor readings list of integers starts as [21, 22, 20, 23, 22]. A technician checks one specific reading using an index, like looking up a time stamp in a log. The code prints readings[3] using zero-based index. No readings are modified or removed. The list stays in the same order. Based on the scenario above, what is the output after executing the following list operation?
  20. What is the most likely consequence of using this system in a public setting with a diverse population?

Practice tests