Skip to main content

AP Computer Science Principles Unit 4 practice questions

Try 10 multiple-choice questions from Unit 4 here. Pick an answer to see why it's right or wrong, then take the timed test above for a full AP-style set.

  1. Question 1

    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.

  2. Question 2

    A global team of developers agrees to use the standard TCP/IP protocols for transmitting data between their servers rather than creating a custom protocol. How does this decision to use a standard abstraction reduce complexity for the team?

    It eliminates the need to design and debug low-level data transmission rules from scratch.

    It guarantees that the data transmitted between servers is automatically encrypted and secure.

    It prevents the servers from communicating with devices that do not belong to the organization.

    It increases the bandwidth available for data transmission by compressing the data packets.

    Show answer

    Answer: (A)

    Linking the use of standard protocols to the avoidance of redundant low-level work.

  3. Question 3

    A messaging app is being developed for journalists working in hostile environments where communication interception is a major threat. Which encryption protocol best fits this purpose?

    End-to-end encryption where only the sender and receiver hold the keys

    Server-side encryption where the service provider manages the keys

    Transport layer security that encrypts data only while in transit

    No encryption to ensure messages can be recovered if a password is lost

    Show answer

    Answer: (A)

    Evaluating the security threat model indicates that third-party access must be eliminated. End-to-end encryption ensures that not even the service provider can access the messages, fitting the high-security purpose.

  4. Question 4

    A concert venue wants a program to prevent overbooking by processing ticket requests in real-time. Which aspect of the program's behavior must be investigated to ensure this function works correctly?

    How the system manages concurrency when multiple users select the same seat

    How the system manages latency when multiple users select the same seat

    How the system manages bandwidth when multiple users select the same seat

    How the system manages storage when multiple users select the same seat

    Show answer

    Answer: (A)

    Investigating concurrency logic is essential to ensure the program can handle simultaneous inputs without assigning the same seat to two different users.

  5. Question 5

    When sending an email, the email client uses standard protocols like the Simple Mail Transfer Protocol (SMTP) without handling the physics of signal transmission. How does this layering of abstraction manage complexity?

    It separates concerns so software developers can build applications without managing electrical signals.

    It eliminates latency so the email arrives at its destination instantly regardless of distance.

    It prevents data loss so the email is guaranteed to be delivered even if the network cable is cut.

    It encrypts the content so the email cannot be read by anyone other than the intended recipient.

    Show answer

    Answer: (A)

    Layering allows developers to work at the application level, relying on lower layers to handle physical transmission details, which simplifies application development.

  6. Question 6

    In a multiplayer online game, Player A sees Player B's character move across the screen. What data serves as the input to Player A's computer to enable this?

    Data packets from the server containing Player B's coordinates serve as input to Player A.

    The graphics rendered on Player A's monitor serve as input to the game's physics engine.

    The keyboard commands from Player A serve as input to control Player B's character movement.

    The local game files on Player A's hard drive serve as input to determine network speed.

    Show answer

    Answer: (A)

    Tracing the network communication reveals the input source. Player A's computer receives coordinate data from the server as input to update the local game state.

  7. Question 7

    A company plans to build a smart light bulb that users can control via an existing popular home automation hub. What technical specification must the developers investigate to ensure compatibility?

    The communication protocols supported by the home automation hub

    The maximum number of devices the home automation hub can simultaneously connect to

    The operating system installed on the home automation hub's central processor

    The electrical power consumption rating of the home automation hub during normal operation

    Show answer

    Answer: (A)

    To interface with an external system, the device must use a compatible communication standard (like Zigbee or Wi-Fi) supported by that hub.

  8. Question 8

    A voting system uses this algorithm: Step 1: Read voterID. Step 2: Check votedList. Step 3: If voterID is in votedList, reject. Step 4: Add voterID to votedList and accept. Two machines run this algorithm simultaneously. If both read the same ID at the same time, what is the risk?

    Both machines might accept the vote because the ID was not yet added

    Both machines might reject the vote because the ID was already added

    One machine will accept and the other will reject the vote correctly

    The system will crash due to simultaneous access to the list file

    Show answer

    Answer: (A)

    This describes a race condition. If Machine A and Machine B both execute Step 2 before either executes Step 4, both will see the ID is missing and both will proceed to accept the vote, resulting in a double vote.

  9. Question 9

    Web browsers use HTTP to request pages without knowing how the data is physically routed through cables. Which statement best explains this abstraction's role?

    It separates the concern of data formatting from data transmission, allowing different systems to interoperate.

    It separates the concern of data formatting from data transmission, allowing different systems to hide implementation details.

    It separates the concern of data formatting from data transmission, allowing different systems to reduce latency.

    It separates the concern of data routing from data transmission, allowing different systems to interoperate.

    Show answer

    Answer: (A)

    This is correct: HTTP handles how data is formatted and structured at the application level, while lower layers manage the actual transmission across cables and networks. This separation lets systems built on different hardware or software interoperate as long as they follow the same protocol.

  10. Question 10

    IPv4 addresses use 32 bits, limiting the number of unique devices. IPv6 uses 128 bits. How does a network library abstraction manage the complexity of transitioning between these standards?

    It provides a unified interface that handles both address types transparently

    It forces all devices to upgrade to IPv6 before they can communicate data

    It converts all IPv6 addresses into IPv4 addresses by truncation logic

    It assigns multiple devices to the same IP address to save address space

    Show answer

    Answer: (A)

    The library hides the low-level bit differences between the protocols, allowing the application to work regardless of the underlying address size.

What's on the AP Computer Science Principles Unit 4 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 831 multiple-choice questions written for Unit 4, Computer Systems & Networks.

Review Unit 4 before you start

Other AP Computer Science Principles unit tests