AP CSP MCQ Retrospective & Improvement Plan


Performance Analysis

After reviewing my AP CSP Practice Exam 1 results, I’ve identified key areas of strength and improvement. My goal is to build on what I know while targeting weak points to maximize my exam score.


Strengths: Areas Where I Excelled

  • Data Representation & Storage: Confident with binary, data compression, and using data in programs.
  • Control Structures & Algorithms: Strong understanding of loops, conditionals, and algorithm logic.
  • Networking & The Internet: Solid grasp on parallel computing, Internet structure, and fault tolerance.
  • Computing Ethics & Security: Comfortable with cybersecurity, computing bias, and legal implications.

Areas for Improvement

  • Debugging & Error Correction: Need to better identify and fix logical errors in code.
  • Library & API Usage: Struggled with using built-in libraries and understanding API documentation.
  • Algorithm Efficiency: Improve understanding of Big-O notation and optimizing code performance.
  • Data Abstraction: Practice function/variable abstraction for cleaner, more reusable code.

Action Plan for Improvement

To improve before the final AP CSP exam, I will:

  • Debugging Practice: Solve logic-based coding problems that require fixing bugs.
  • Review API Documentation: Practice with APIs (e.g. math, random, or fetch() in JS) to get familiar with documentation.
  • Study Algorithm Efficiency: Focus on analyzing and comparing algorithms (e.g., binary search vs linear).
  • Refactor Code: Clean up and simplify code by using functions and meaningful variable names.

________________________________

A programmer is designing an algorithm to navigate a robot through a grid of squares. The robot starts facing upward and can move into white or gray squares, but not black regions. The goal is to move the robot to a gray square in the bottom-left corner of the grid. The Boolean function goalReached() evaluates to true when the robot reaches the gray square.

Which of the following code segments correctly moves the robot to the gray square?

Answer:
IF (CAN_MOVE(left)) { ROTATE_LEFT() } MOVE_FORWARD()

Explanation:
This code segment uses a left-checking strategy to guide the robot through the grid. On each iteration of the REPEAT UNTIL(goalReached()) loop:

  • It first checks if there is an open square to the left.
    • If there is, the robot rotates left.
  • Then, regardless of whether it rotated, the robot moves forward one square.

This logic creates the following path:

  1. The robot moves forward 3 squares from its starting position.
  2. It then detects a leftward path and rotates left.
  3. The robot moves forward 3 more squares.
  4. It once again detects a leftward path and rotates left.
  5. Finally, it moves forward 3 more squares, reaching the gray goal square.

By combining left-detection with consistent forward movement, this algorithm ensures that the robot navigates the correct route to the goal.


A network diagram shows devices A through I connected by lines, where each line represents a direct communication link between two devices. Any communication between devices not directly connected must pass through one or more intermediary devices. For example, devices A and B are directly connected, but A and G are not and require other devices to relay the information.

Which of the following statements is true about the network?

Answer: C
If devices B and F fail, then device A will not be able to communicate with device G.

Explanation:
Device A can reach device G by going through B → E → G or through C → D → F → E → G. If both B and F fail, then both of these paths become unusable. As a result, device A is cut off from device G. Therefore, this is the correct statement because failure of B and F isolates part of the network.


A network diagram shows physically connected devices labeled A through I. A line between devices means they can communicate directly. If devices are not directly connected, information must pass through one or more intermediary devices. For example, information from A to G must be routed through other devices.

Which of the following statements is true about the network?

Answer: C
If devices B and F fail, then device A will not be able to communicate with device G.

Explanation:
If device B fails, the path from A → B → E → G is broken.
If device F fails, the alternate path from A → C → D → F → E → G is also broken.
Since both possible paths to G are blocked, device A becomes unable to communicate with device G.
Therefore, devices B and F are both critical links in A’s ability to reach G, making C the correct choice.


The following question uses a robot in a grid of squares. The robot is represented by a triangle, which is initially facing right. The robot needs to follow the arrows on the grid to reach the gray square.

Which of the following code segments will move the robot to the gray square along the path indicated by the arrows?

Answer: C botStepper(2) MOVE_FORWARD botStepper(3)

Explanation: The first call to botStepper(2) moves the robot forward two squares, rotates it left (now facing up), moves forward two squares, and then rotates right (now facing right). Then MOVE_FORWARD moves the robot one square forward. The second call to botStepper(3) moves it forward three squares, rotates left (now facing up), moves forward three squares, and then rotates right (now facing right). The robot ends in the gray square as expected.


A student is developing an algorithm to determine which of the restaurants that accept credit cards has the greatest average customer rating. Restaurants that have not yet received any customer ratings and restaurants that do not accept credit cards are to be ignored.

Which of the following sequences of steps can be used to identify the desired restaurant?

I. Filter by number of ratings, then filter by payment type, then sort by rating
II. Filter by number of ratings, then sort by rating, then filter by payment type
III. Sort by rating, then filter by number of ratings, then filter by payment type

Answer: D

Explanation:
Correct. Because the relative order of the rows is not changed when the filters are applied, the order in which the actions are performed does not matter. The filtering can occur either before or after the spreadsheet is sorted by rating.


A list of numbers has n elements, indexed from 1 to n. The following algorithm is intended to display true if the value target appears in the list more than once and to display false otherwise. The algorithm uses the variables position and count. Steps 4 and 5 are missing.

Which of the following could be used to replace steps 4 and 5 so that the algorithm works as intended?

Answer: A

Explanation:
Correct. This choice correctly repeats Steps 2 and 3 for all values of position from 1 to n, then checks whether count is at least 2. If so, it displays true. Otherwise, it displays false, which is the intended behavior. This avoids accessing elements outside the bounds of the list.


A certain computer has two identical processors that are able to run in parallel. The table indicates how long it takes each of the four processes to run on a single processor. Assume that none of the processes depend on each other.

Which of the following parallel computing solutions would minimize the amount of time it takes to execute all four processes?

Answer: A

Explanation:
Correct. With two processors running in parallel, execution time is minimized when the workload is split as evenly as possible. Running processes P and Q on one processor takes a total of 40 seconds. Running processes R and S on the other processor takes a total of 35 seconds. Since the processors run in parallel, the total execution time is the maximum of the two workloads, which is 40 seconds.


The following table shows the value of expression based on the values of input1 and input2.

Which of the following expressions are equivalent to the value of expression as shown in the table? Select two answers.

Answer: A and D

Explanation:
Correct. When input1 and input2 are both true, the expressions (NOT input1) and (NOT input2) are both false, so (NOT input1) OR (NOT input2) will evaluate to false. In all other cases, either (NOT input1) or NOT input2 (or both) will evaluate to true, so (NOT input1) OR (NOT input2) will evaluate to true. Likewise, NOT(input1 AND input2) is logically equivalent (by De Morgan’s Law) and will yield the same results for the full truth table.


In certain video games, players are awarded bonus points at the end of a level based on the value of the integer variable timer. The bonus points are awarded as follows:

  • If timer is less than 30, then 500 bonus points are awarded.
  • If timer is between 30 and 60 (inclusive), 1000 bonus points are awarded.
  • If timer is greater than 60, then 1500 bonus points are awarded.

Which of the following code segments assigns the correct number of bonus points to bonus for all possible values of timer? Select two answers.

Answer: A and C

Explanation:
Both answer choices A and C assign the correct value to bonus by checking the conditions in the proper order using mutually exclusive IF-ELSE logic. This avoids overwriting values unintentionally.

Choice B is incorrect because it incorrectly reassigns bonus even after meeting the condition for 1500. For example, if timer is 65, the first condition sets bonus to 1500, but the second block sets it again to 1000. The last assigned value would be 1000, which is incorrect.

Choice D is incorrect because the nested conditional logic does not properly handle overlapping conditions and fails in edge cases.


Focus Concepts to Review Based on the Question:

  • Order of conditional statements (most specific to least specific)

  • Difference between IF, IF-ELSE, and chained IF-ELSE IF statements

  • Avoiding multiple IF blocks that can overwrite values

  • Understanding how overlapping conditions affect logic flow

  • Using mutually exclusive conditions to prevent conflicts

  • Testing boundary values and edge cases (e.g., timer = 30, timer = 60)

  • Logical reasoning with compound conditionals

  • Reading and translating flowcharts into code