CSPIQ · AP Computer Science Principles · Mock Exam 1
CSPIQ · AP Computer Science Principles

CSPIQ Mock Exam 1 — AP Computer Science Principles


Full Section I Simulation

Time: 120 minutes · 70 questions · No calculator (none needed) Format matches the real exam: Q1–57 single-select · Q58–62 reading passage + 5 single-select · Q63–70 multiple-select ("Select two answers")

Instructions: One sitting, timed. The Exam Reference Sheet (AP pseudocode) is provided on the real exam; this mock uses the same conventions — lists are 1-indexed, RANDOM(a, b) is inclusive, REPEAT UNTIL stops when its condition becomes true. Answer every question; there is no penalty for guessing. Target pace: ~100 seconds per question, with the passage set (Q58–62) budgeted at 9 minutes total.

Take this mock after Lesson 24. Score with the key at the end, then use the review pointers before attempting Mock Exam 2.


Questions 1–57: Single-Select

Question 1
A program's documentation is MOST useful to collaborators when it:
Question 2
What is the decimal value of the binary number 101011?
Question 3

What is displayed?

a ← 6
b ← 2
a ← a MOD b
b ← b + a
DISPLAY (a + b)
Question 4
A navigation app's stated goal is "helping drivers avoid traffic delays." In CED terms, this goal is the program's:
Question 5
Which situation produces a run-time error?
Question 6

words ← ["ash", "elm", "oak", "fir"]. What is displayed?

DISPLAY (words[2])
DISPLAY (words[LENGTH(words) − 1])
Question 7
A hospital must store patient X-ray images so radiologists can review every original detail years later. The images should be compressed:
Question 8

For which value of x does this code display "yes"?

IF (x > 10 AND x MOD 5 = 0)
{
    DISPLAY ("yes")
}
Question 9
Which is metadata for a video file?
Question 10
A team of programmers with varied backgrounds reviews a photo app's design. According to the CED, the MOST likely benefit is:
Question 11

How many times is "go" displayed?

n ← 2
REPEAT UNTIL (n > 16)
{
    DISPLAY ("go")
    n ← n * 2
}
Question 12
A survey about smartphone usage is distributed only through a smartphone app. The results overstate average usage. The BEST explanation is:
Question 13

What does f(4) return?

PROCEDURE f(n)
{
    IF (n MOD 2 = 0)
    {
        RETURN (n * 10)
    }
    RETURN (n + 1)
}
Question 14
The minimum number of bits needed to assign a unique ID to each of 60 classrooms is:
Question 15
A robot faces east. It executes ROTATE_RIGHT() once, then ROTATE_RIGHT() again. It now faces:
Question 16
Which task is MOST appropriate for lossy compression?
Question 17

What is displayed?

total ← 0
FOR EACH v IN [3, 0, 5, 2]
{
    IF (v > 0)
    {
        total ← total + 1
    }
}
DISPLAY (total)
Question 18
A program stores a growing collection of donation amounts. Compared with using a separate variable for each donation, a list is better primarily because:
Question 19
Which Boolean expression is equivalent to NOT (score ≥ 70)?
Question 20
The Internet's design allows networks built by different companies, in different countries, on different hardware, to exchange data because:
Question 21

What is displayed?

L ← [8, 3, 6]
APPEND(L, 1)
REMOVE(L, 1)
DISPLAY (L[1] + L[3])
Question 22
Which of the following is a computing innovation?
Question 23
A programmer needs a random integer that models drawing one card position from a 52-card deck. Which expression is correct?
Question 24

What does this code display for data ← [10, 20, 30, 40]?

result ← data[1]
FOR EACH d IN data
{
    IF (d > result)
    {
        result ← d
    }
}
DISPLAY (result)
Question 25
DNS's role when a user visits example.org is to:
Question 26

Trace this code. What are the final values of x and y?

x ← 5
y ← 12
temp ← x
x ← y
y ← temp
Question 27
A city releases traffic-sensor data. Analysts find intersections with more sensors report more congestion incidents, and conclude those intersections are the most congested. The MOST important flaw is:
Question 28
Which loop is guaranteed never to terminate?
Question 29
In the AP pseudocode, INSERT(L, 3, "new") does what?
Question 30
A program should display "leap-eligible" when year is divisible by 4. Which condition is correct?
Question 31
The primary difference between TCP and UDP is:
Question 32

What does g(3, 5) return?

PROCEDURE g(a, b)
{
    result ← 0
    REPEAT b TIMES
    {
        result ← result + a
    }
    RETURN (result)
}
Question 33
A student's program works for typical inputs but crashes when the input list is empty. The BEST characterization is:
Question 34
Which sequence of commands moves the robot from the bottom-left square of a 3×3 open grid (facing north) to the top-right square?
Question 35
Combining a store's purchase records with its loyalty-card signup data (shared field: member ID) allows analysts to answer which NEW question?
Question 36
A black-and-white image row is WWWWWWWWWWBBBBBWWWWW (10 W, 5 B, 5 W). Its run-length encoding is:
Question 37
A county moves vaccine appointment booking exclusively to a website. Appointment rates drop sharply among elderly residents. This outcome BEST illustrates:
Question 38
Which statement about packets is true?
Question 39
A microphone samples a sound wave 48,000 times per second, storing each measurement digitally. Halving the sampling rate to 24,000 would:
Question 40
A museum invites the public to transcribe thousands of handwritten historical letters through a website. This approach is best described as:
Question 41
A network connects four servers with redundant links so that any single link can fail without disconnecting any server. The property this design provides is:
Question 42

What is displayed?

PROCEDURE twist(s)
{
    RETURN (s + s)
}
word ← "ab"
word ← twist(word)
DISPLAY (twist(word))
Question 43
A loan-approval model trained on decades of past decisions gives systematically lower scores to applicants from certain zip codes. The developers wrote no rules about zip codes and hold no ill intent. The MOST accurate description is:
Question 44
A photographer posts images under a Creative Commons license requiring attribution and prohibiting commercial use. Which use complies?
Question 45
A design uses 6 bits per ID but must expand to identify twice as many items. The number of bits needed is:
Question 46
A job consists of a 10-second segment that must run sequentially, followed by four independent 20-second tasks. With four processors available for the parallel portion, the total time is:
Question 47
An email claiming to be from a streaming service says "Your payment failed — click here within 24 hours to keep your account," linking to a look-alike login page. The recommended response is:
Question 48
Binary search runs on a sorted list of 500 names. The maximum number of names examined is closest to:
Question 49
The Internet can grow by millions of devices per year without central coordination primarily because:
Question 50
A table of 200 book records is filtered to keep genre = "mystery" (34 rows survive), then sorted by rating, descending. The resulting table has:
Question 51
Which authentication setup uses two DIFFERENT factor categories?
Question 52
A person's gym check-in times, grocery delivery address, and tagged vacation dates are each posted on different services. The privacy risk the CED emphasizes is:
Question 53
A dataset lists temperatures as "72", "72.0", "seventy-two", and "72 F". Before computing an average, the analyst should:
Question 54
A research task must process a dataset so large that no single computer can store it. The MOST appropriate approach is:
Question 55
A developer publishes a game engine's source code under a license allowing anyone to use, modify, and redistribute it. Within a year, hundreds of developers have fixed bugs and added features. This illustrates:
Question 56
A program compiles a shopping total. During checkout with exactly 100 items, the displayed total is wrong; with 99 or fewer it is correct. The debugging strategy MOST likely to locate the error is:
Question 57
A video-doorbell system lets homeowners see deliveries remotely (intended). Neighborhoods later use aggregated doorbell footage to track "unfamiliar" individuals, disproportionately flagging certain groups. The tracking outcome is best described as:

Questions 58–62: Reading Passage

MealBridge is a nonprofit app connecting restaurants with surplus food to nearby food banks. Each evening, participating restaurants photograph and list their surplus (type, quantity, pickup deadline). The app's matching procedure ranks nearby food banks by refrigerated-storage capacity and driving distance, then notifies the top match, which can accept or pass; a pass notifies the next-ranked bank. Restaurants' listings, banks' acceptance histories, and pickup GPS routes are stored on MealBridge's servers. A public dashboard shows citywide totals — meals rescued, pounds diverted from landfills — without naming participants. MealBridge notes that participation requires a smartphone and that listings are English-only, and it reports matches are completed for 78% of listings, with unmatched food usually in neighborhoods with few nearby member banks.

Question 58
The primary purpose of MealBridge is to:
Question 59
Which data does the matching procedure use to rank food banks?
Question 60
The public dashboard's design — totals only, no participant names — most directly addresses:
Question 61
Which passage detail MOST directly suggests a digital-divide concern?
Question 62
Unmatched food concentrates in neighborhoods with few member banks. Which change would MOST directly address this gap?

Questions 63–70: Multiple-Select — Select TWO answers for each. Both must be correct to earn the point.

Question 63
L ← [5, 10, 15]. Which operations result in a list of length 4? *(Select two.)
Question 64
Which statements correctly pair a protocol with its role? *(Select two.)
Question 65
A ride-sharing platform reduces drunk driving in a city while increasing downtown congestion and reducing public-transit ridership. Which analyses are consistent with the CED? *(Select two.)
Question 66
Which statements about metadata are true? *(Select two.)
Question 67
Which code segments display a value that is GUARANTEED to be 12? *(Select two.)
Question 68
A team is developing a quiz app. Which practices does the CED specifically endorse? *(Select two.)
Question 69

Which statements about this procedure are true? (Select two.)

PROCEDURE check(list, target)
{
    FOR EACH item IN list
    {
        IF (item = target)
        {
            RETURN (true)
        }
    }
    RETURN (false)
}
Question 70
Which practices reduce the risk of account compromise? *(Select two.)

---

Show answer key & explanations

Mock Exam 1 — Answer Key & Review Guide

Scoring: 1 point per question (multi-select questions require BOTH correct answers). Total: 70 points.

Questions 1–35

Q Ans Why (and why not) Review
1 C Documentation during development, explaining the why, helps collaborators; (A) is the anti-pattern L2
2 A 32+8+2+1 = 43; (B) drops the 1s bit L3
3 B a ← 6 MOD 2 = 0; b ← 2+0 = 2; displays 2 L7
4 B The goal/why = purpose; function would describe behavior L1
5 B Divide-by-zero during execution = run-time; (A) syntax, (C) logic L2
6 A words[2] = "elm"; LENGTH−1 = 3 → "oak" (1-indexed!) L8
7 B "Every original detail later" = lossless's exact use case L4
8 C 25 > 10 ✓ AND 25 MOD 5 = 0 ✓; (B) fails MOD; (A)/(D) fail the > L9
9 C Duration + date describe the video; frames/audio/dialogue are content L5
10 B Diverse perspectives catch blind spots — the CED's collaboration claim L1
11 B n = 2, 4, 8, 16 each fail > 16 (16 is not > 16) → 4 displays; stops at 32 L11
12 C Collection-method bias: only smartphone users could respond L5
13 B 4 is even → RETURN (40); the second RETURN never runs L14
14 B 2⁶ = 64 ≥ 60; 2⁵ = 32 is too few L3
15 A East → south → west; two rights = 180° L10
16 B Streaming on limited bandwidth tolerates loss; (A)/(D) need exactness L4
17 C Positives: 3, 5, 2 → count 3 (note it counts, not sums — the +1 body) L12
18 B Data abstraction: code survives data-size changes L8
19 A NOT(≥ 70) ⟺ < 70; equality switches sides — (B) wrongly keeps 70 L9
20 B Shared open protocols = universal interoperability L17
21 B [8,3,6] → [8,3,6,1] → remove index 1 → [3,6,1]; L[1]+L[3] = 3+1 = 4 L8
22 C The thermostat's program is integral to its function; (A)/(B)/(D) are made/sold using computers L1
23 B 1..52 inclusive = 52 outcomes; (A) has 53 including 0; (C) has 51 L15
24 D Max-finder silhouette; honest init from data[1] → 40 L12
25 C Names → IP addresses; nothing more, nothing less L17
26 A Textbook three-step swap: temp saves 5; x = 12, y = 5 L7
27 B Measurement coverage drives counts — collection bias, not congestion truth L5
28 D 1 → 5 → 9 → ... skips 7 (step 4 from 1 lands on 1, 5, 9...); x = 7 never true → infinite. (A)/(B) reach their stops; (C) starts true → zero runs L11
29 B INSERT places at the index and shifts right; (A) is replacement, (C) is APPEND L8
30 A Divisible by 4 ⟺ remainder 0; (D) reverses the operands L7
31 B Guaranteed-complete-ordered vs. fast-unguaranteed — the transport trade-off L17
32 C Adds a (=3) b (=5) times → 15 L11, L14
33 B Untested boundary (empty list) → run-time crash; fixable, common, instructive L2
34 A Facing north: 2 forward (top-left), right → east, 2 forward (top-right); (B) turns west off-grid; (C) never goes north L10
35 C Purchases + zip codes live in different tables; member ID joins them. (A)/(B)/(D) each need only one table L6

Questions 36–57

Q Ans Why (and why not) Review
36 D Runs: 10 W, 5 B, 5 W — count each run once; (A) miscounts the tail L4
37 A Online-only service + access gap = divide converting into outcome gap L21
38 C Independent routing → possible reordering → sequence numbers L17
39 D Fewer samples = smaller file, coarser approximation — fidelity and size move together L3
40 A Large task + many volunteers + Internet = crowdsourcing (transcription is a classic) L20
41 C Surviving component failure = fault tolerance (via redundancy) L18
42 D word becomes "abab"; twist("abab") = "abababab" (8 characters) L14, L8
43 D Bias inherited from historical data — no intent required; (A) is the intent fallacy L21
44 A Non-commercial + credited = both terms satisfied; (B)/(D) are commercial; (C) violates both L22
45 D One more bit doubles capacity: 6 → 7 bits; (A) doubles the bits L3
46 C 10 + max(20,20,20,20) = 30; four processors run the tasks simultaneously L19
47 A Urgency + link + credentials = phishing; navigate directly instead L23
48 D 500 ≤ 512 = 2⁹ → ~9 examinations; halving chain, not half the list L13
49 C Open protocols + decentralization = permissionless growth L17
50 D Filter keeps 34; sort reorders those 34, top-rated first — row counts never change in a sort L6
51 A Know (password) + are (fingerprint); (B)/(C)/(D) repeat one category L23
52 D Aggregation: three innocuous posts = identity + patterns + absences L23
53 D Equivalent values, inconsistent formats → clean to one representation L5
54 C Exceeds one machine's storage → distribute data and work L19
55 A Open source's collaborative-improvement story; (C) confuses licensed code with public domain L22
56 D The bug lives at the 100 boundary — trace there, display intermediates there L2
57 C Unintended + harmful + scale-amplified + bias-raising; (D) is an absolutist non-answer L20, L21

Questions 58–62 (Passage)

Q Ans Why (and why not) Review
58 C Purpose = redirect surplus to banks, reduce waste; stated in sentence one L24, L1
59 A The passage names exactly two ranking inputs: storage capacity, driving distance. (B) is data the system stores but the passage doesn't say the ranking uses L24
60 D Totals-without-names is a privacy-by-aggregation choice — participants' individual patterns stay unexposed L23, L24
61 D Smartphone requirement + English-only listings = access barriers by device and language L21
62 A The gap's stated cause is bank coverage; the matching remedy targets that cause. (B)–(D) fix nothing about coverage L21, L24

Questions 63–70 (Multi-Select — both required)

Q Ans Why (and why not) Review
63 A, C APPEND and INSERT each add one element (3 → 4). (B) replaces in place; (D) shortens to 2 L8
64 B, D IP = addressing/routing; TCP = complete/ordered/retransmitting. (A) gives DNS a delivery job; (C) gives UDP the guarantee it defines itself by lacking L17
65 A, C Dual effects + unintended consequences — the CED's core IOC claims. (B) denies effects-beyond-purpose; (D) confuses outcomes with errors L20
66 B, C Timestamp/GPS describe the photo; changing metadata leaves content untouched. (A) inverts the definition L5
67 A, D (A): 4 → 8 → 12 deterministically. (D): 12, deterministically. (B) ranges 2–12; (C) ranges 10–12 — random values are never guaranteed L15, L11
68 C, D Iterative feedback + component testing with boundary inputs — both named CED practices. (A)/(B) are the named anti-patterns L2
69 A, B Early RETURN exits on first match; absent target → full scan → false. (C) describes a counter (no early exit); (D): empty list → loop runs zero times → returns false, no error L14, L12
70 B, D True MFA + unique long passwords. (A) is one breach from total compromise; (C) is phishing compliance L23

Scoring Worksheet

1. Raw score: ______ / 70 (multi-select counts only when both answers are correct)

2. Section I percentage: raw ÷ 70 × 100 = ______ %

3. Estimated composite (Section I is 70% of the exam; assume your Create PT + written responses land in the middle band until scored):

Section I raw With a solid PT (≈4–5 of 6 pts) With a weaker PT (≈2–3 of 6 pts)
55–70 5 likely 4–5
45–54 4 likely 3–4
35–44 3 likely 3
27–34 2–3 2
below 27 2 1–2

These bands are ESTIMATES built from published score distributions and typical cut ranges — actual AP cut scores vary by year and form. Use them for study prioritization, not prediction.

4. Diagnosis by Big Idea — tally your misses:

Big Idea Questions Missed If 3+ missed, reread
CRD (Creative Development) 1, 4, 5, 10, 22, 33, 56, 68 ___ / 8 L1–L2
DAT (Data) 2, 7, 9, 12, 14, 16, 27, 35, 36, 39, 45, 50, 53, 66 ___ / 14 L3–L6
AAP (Algorithms & Programming) 3, 6, 8, 11, 13, 15, 17, 18, 19, 21, 23, 24, 26, 28, 29, 30, 32, 34, 42, 48, 63, 67, 69 ___ / 23 L7–L16
CSN (Systems & Networks) 20, 25, 31, 38, 41, 46, 49, 54, 64 ___ / 9 L17–L19
IOC (Impact of Computing) 37, 40, 43, 44, 47, 51, 52, 55, 57, 58–62, 65, 70 ___ / 16 L20–L24

Appendix: Written-Response Practice (Section II rehearsal)

On the real exam you'll answer two written-response questions about YOUR Create PT, using your Personalized Project Reference. Practice the format on this sample PPR first, then re-answer every prompt about your own program.

Sample program: "PantryPal" (tracks pantry items and flags soon-to-expire food)

PPR Screenshot i–ii (list creation and use):

pantry ← []                          ← list created empty
daysLeft ← []
...
APPEND(pantry, itemName)             ← list grows as the user adds items
APPEND(daysLeft, days)

PPR Screenshot iii–iv (procedure and call):

PROCEDURE countExpiring(dayList, limit)
{
    count ← 0
    FOR EACH d IN dayList
    {
        IF (d ≤ limit)
        {
            count ← count + 1
        }
    }
    RETURN (count)
}

soon ← countExpiring(daysLeft, 3)    ← the call
DISPLAY (soon)

Practice prompts (one per official category)

WR 1 (Program Design, Function, and Purpose): Describe the purpose of PantryPal, then describe how a user interacts with it from input to output. Model: The purpose is to reduce household food waste by warning users which pantry items expire soon. The user enters each item's name and days until expiration; the program stores them in parallel lists and, on request, displays how many items expire within 3 days.

WR 2(a) (Algorithm Development): Explain how the algorithm in countExpiring determines its result, including the role of selection and iteration. Model: The FOR EACH loop (iteration) examines every value in dayList exactly once. The IF statement (selection) compares each value to limit; only values at or below it increment count. After the loop, count holds the number of qualifying items, which the procedure returns. Without the selection, every item would be counted; without the iteration, only one hard-coded item could be checked.

WR 2(b) (Errors and Testing): Describe a test case for countExpiring including input and expected output, and an error the test could reveal. Model: Input: dayList = [1, 3, 7], limit = 3; expected output: 2 (the 1 and the 3 — the boundary value must count because the comparison is ≤). If the procedure returned 1, the comparison was likely written < instead of — a boundary logic error this test is specifically designed to expose. A second test with an empty list (expected 0) confirms no run-time error occurs.

WR 2(c) (Data and Procedural Abstraction): Explain how the list daysLeft manages complexity in the program. Model: daysLeft stores every item's remaining days under one name, so the program processes all of them with a single loop over the list. Without it, the program would need a separate variable per item and could not handle a change in the number of items without rewriting the code; with it, the same code works for 3 items or 300.

Now: answer all four prompts for YOUR program, in writing, without looking at these models. If any answer requires information not visible in your own PPR screenshots, improve the screenshots — that gap is exactly what costs points on exam day.


Mock Exam 2 is a fresh full simulation at slightly higher code-analysis difficulty. Take it after reviewing your misses here — ideally one week later, timed, in one sitting.

Score summary

Your running multiple-choice score appears in the bar below. Self-score the free-response section with the rubrics in the answer key, then use the diagnostic table to target review.

← All lessons
Mock Exam 2 ›
--:--Score: 0/0 correct