Big Idea 3 Unit Test Part B: Lists, Procedures, and Abstraction (3.10-3.18) | AP CSP Practice Test
AP CSP Course›Big Idea 3›Big Idea 3 Unit Test Part B: Lists, Procedures, and Abstraction (3.10-3.18)
Test
Big Idea 3 • Algorithms and Programming
Big Idea 3 Unit Test Part B: Lists, Procedures, and Abstraction (3.10-3.18)
📝 14 questions🎯 AP exam difficulty✅ Auto-scored
📋 Unit Test instructions
Part B of the Big Idea 3 test covers topics 3.10 through 3.18.
Answer all 14 questions, then press Submit test. You will see your score, which questions you missed, and the correct answer with an explanation. Passing is 70%, the AP benchmark. You can retake it.
0 of 14 answered
Question 1 of 14Lists: trace operations
Consider the AP pseudocode below, where lists are 1-indexed. What does the list nums contain after all statements run?
The 1-indexed list scores holds [70, 85, 90, 60, 95]. A student wants the value 60. Which expression and reasoning are correct?
scores <- [70, 85, 90, 60, 95]
Answer: B. Correct. With 1-indexing, positions are 1 through 5, and 60 sits at position 4, so scores[4] returns 60.
Question 3 of 14Lists: traversal
The procedure below traverses a list of integers. For the input [3, 1, 4, 1, 5], what value does it DISPLAY?
PROCEDURE mystery(data)
{
best <- data[1]
FOR EACH item IN data
{
IF (item > best)
{
best <- item
}
}
DISPLAY(best)
}
Answer: C. Correct. The traversal keeps the largest value seen; 5 is the maximum of [3, 1, 4, 1, 5].
Question 4 of 14Binary search: prerequisite
A programmer wants to use binary search to find a target value in a list. Which statement is correct about when binary search can be applied and why it is efficient?
Answer: C. Correct. Binary search needs a sorted list; each comparison discards roughly half of the remaining search space.
Question 5 of 14Binary search: step count
A sorted list contains 1000 elements. In the WORST case, about how many comparisons does binary search need? Use the fact that each step roughly halves the remaining elements.
Answer: B. Correct. Halving 1000 repeatedly (1000, 500, 250, ... , 1) takes about 10 steps, since 2^10 is 1024.
Question 6 of 14Calling procedures
Consider the procedure definition and call below. What value is displayed?
PROCEDURE combine(a, b)
{
RETURN a * 10 + b
}
result <- combine(3, 7)
DISPLAY(result)
Answer: D. Correct. The arguments 3 and 7 bind to parameters a and b, so the procedure returns 3 * 10 + 7 = 37.
Question 7 of 14Developing procedures: abstraction
A program repeats the same seven lines of code in five different places to convert a temperature. A developer replaces those lines with a single procedure that is called in all five places. Which statement best describes the MAIN benefit, according to procedural abstraction?
Answer: D. Correct. Procedural abstraction manages complexity through reuse and a single point of change, hiding the detail behind a named procedure.
Question 8 of 14Libraries and APIs
A student uses a graphics library by calling drawCircle(x, y, r) without knowing how the pixels are actually rendered. Which statement best describes what a software library and its API provide?
Answer: A. Correct. A library is a set of existing procedures, and its API documents how to use them without seeing or rewriting their implementation.
Question 9 of 14Random values: range
In AP pseudocode, RANDOM(a, b) returns a random integer from a to b, inclusive. A game uses RANDOM(2, 8). Which statement is correct?
roll <- RANDOM(2, 8)
Answer: A. Correct. RANDOM(2, 8) is inclusive of both ends, giving the 7 integers from 2 through 8.
Question 10 of 14Random values: probability
RANDOM(1, 5) returns each integer from 1 to 5 with equal likelihood. What is the probability that a single call returns a value greater than 3?
value <- RANDOM(1, 5)
Answer: C. Correct. The outcomes are 1, 2, 3, 4, 5; only 4 and 5 exceed 3, so the probability is 2 out of 5.
Question 11 of 14Simulations
A team builds a computer simulation of traffic flow at an intersection instead of testing changes on the real road. Which of the following are accurate reasons to prefer the simulation?
I. It can test dangerous or costly scenarios safely and cheaply
II. It can run many trials quickly using randomness to model variation
III. It perfectly reproduces every real-world detail with no simplifying assumptions
Answer: A. Correct. Simulations allow safe, low-cost, repeatable testing with randomness, but they rely on simplifying assumptions, so III is false.
Question 12 of 14Algorithmic efficiency
Two algorithms search for a value. Algorithm X checks elements one at a time from the start; Algorithm Y works on a sorted list and halves the remaining range each step. As the list size grows very large, which comparison is correct?
Answer: A. Correct. Linear search (X) grows in proportion to n, while binary search (Y) grows logarithmically, so Y scales far better on large sorted lists.
Question 13 of 14Algorithmic efficiency: reasonable time
In the AP CSP framework, an algorithm runs in a "reasonable" amount of time when its number of steps grows as a polynomial function of the input size (for example, proportional to n or n squared). Which described algorithm does NOT run in a reasonable amount of time?
Answer: B. Correct. Doubling the steps for each added item is exponential growth, which is classified as an unreasonable running time.
Question 14 of 14Undecidable problems
Which statement best defines an undecidable problem, as described in the AP CSP framework?
Answer: B. Correct. An undecidable problem is one for which no algorithm can produce a correct yes/no answer for all inputs.
Get in Touch
Whether you're a student, parent, or teacher — I'd love to hear from you.
Just want free AP CS resources?
Enter your email below and check the subscribe box — no message needed.
Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.
Typically responds within 24 hours
✓
Message Sent!
Thanks for reaching out. I'll get back to you within 24 hours.