Skip to content
StudyFame

AP CSP MCQ Practice Test 2 with Answers

Each question has four options. Pick one to check your answer, or click Show answer to see the answer with an explanation. This test covers networks and fault tolerance, data compression, overflow, parallel computing, bias and tracing loops.

  1. 1. An author publishes an e-book under the Creative Commons "No Rights Reserved" (CC0) license. What does this allow other people to do?

  2. 2. In the network below, each line is a direct connection between two devices:

    A – B      A – C
    B – D      D – C
    B – E      E – F
    F – C

    What is the minimum number of connections that must be removed so that device B can no longer communicate with device C?

  3. 3. Using the same network:

    A – B      A – C
    B – D      D – C
    B – E      E – F
    F – C

    Which statement is true?

  4. 4. How can a weak password make a user's account vulnerable to unauthorized access?

  5. 5. A home router limits the bandwidth available to guest users. What is the effect on guest users?

  6. 6. A program stores a counter in a variable that can only hold whole numbers from −128 to 127. The counter is 127 and the program adds 1. What is the most likely result?

  7. 7. Which code segment moves a robot along the same path and leaves it facing the same direction as Code 0? Assume nothing blocks the robot.

    Code 0
    REPEAT 2 TIMES
    {
      MOVE_FORWARD()
      MOVE_FORWARD()
      ROTATE_RIGHT()
    }
    
    Code 1
    REPEAT 2 TIMES
    {
      ROTATE_RIGHT()
      MOVE_FORWARD()
      MOVE_FORWARD()
    }
    
    Code 2
    count ← 0
    REPEAT UNTIL (count = 4)
    {
      MOVE_FORWARD()
      count ← count + 1
      IF (count = 2)
      { ROTATE_RIGHT() }
    }
    ROTATE_RIGHT()
    
    Code 3
    REPEAT 4 TIMES { MOVE_FORWARD() }
    ROTATE_RIGHT()
    ROTATE_RIGHT()
    
    Code 4
    count ← 0
    REPEAT UNTIL (count = 4)
    {
      MOVE_FORWARD()
      count ← count + 1
      IF (count = 1)
      { ROTATE_RIGHT() }
    }
    ROTATE_RIGHT()
  8. 8. Which statement about the design of the Internet is true?

  9. 9. In which situation is lossy compression the best choice?

  10. 10. What value is returned by the call mystery(5)?

    PROCEDURE mystery(n)
    {
      result ← 0
      j ← 1
      REPEAT n TIMES
      {
        result ← result + j
        j ← j + 1
      }
      RETURN(result)
    }
  11. 11. Which situation is the biggest challenge for parallel computing?

  12. 12. A social media app is testing a new algorithm that suggests friends with similar interests. Which testing plan is LEAST likely to introduce bias?

  13. 13. For which initial values of j and k does this code segment never stop (an infinite loop)?

    REPEAT UNTIL (j = k)
    {
      j ← j + 2
    }
    DISPLAY(j)
  14. 14. What is displayed when this code segment runs?

    j ← 3
    k ← 4
    result ← 0
    REPEAT UNTIL (j > 6)
    {
      IF (j MOD 2 = 0)
      { result ← result + k }
      ELSE
      { result ← result + j }
      j ← j + 1
    }
    DISPLAY(result)
  15. 15. How is a large file usually sent across the Internet?