AP Computer Science Principles - Practice Exam (70 MCQ)

AP Computer Science Principles Practice Exam – 70 Free CSP MCQs with Explanations

About This AP CSP Practice Exam

This free AP Computer Science Principles practice test includes:

  • 70 original, AP-style multiple-choice questions
  • Auto-grading with detailed explanations
  • Estimated AP score (1–5) based on performance
  • Covers algorithms, data, programming, the Internet, cybersecurity, and global impacts
  • Designed for both AP CSP students and teachers

Use this full-length AP CSP practice exam to prepare for the official College Board AP Computer Science Principles test.

Select the best answer for each question.

Question 1.
A program processes a list of temperatures and stores only the values that are above 90 degrees. Which description BEST matches what the program is doing?




Question 2.
Consider the procedure:

PROCEDURE isLarge(x)
{
    RETURN (x >= 100)
}
What will be displayed by the following code?
numbers ← [40, 120, 99]
FOR EACH n IN numbers
{
    DISPLAY(isLarge(n))
}



Question 3.
ASCII uses 7 bits per character. How many different characters can be represented?




Question 4.
A website encrypts all login data using public-key cryptography. Which statement is TRUE?




Question 5.
Which example BEST illustrates data abstraction?




Question 6.
Which of the following is MOST likely a benefit of using a simulation instead of real-world testing?




Question 7.
Which of the following would MOST reduce the digital divide in a rural community?




Question 8.
A list contains the values [3, 6, 9, 12]. What will the following code display?

sum ← 0
FOR EACH x IN list
{
    sum ← sum + (x / 3)
}
DISPLAY(sum)



Question 9.
Which scenario represents a cybersecurity risk involving social engineering?




Question 10.
A student writes a program that repeatedly halves a number until it becomes less than 1. What type of algorithm is this?




Question 11.
Which action MOST protects users from unauthorized access?




Question 12.
Which Boolean expression is equivalent to NOT (A OR B)?




Question 13.
Which of the following BEST illustrates a beneficial impact of crowdsourcing?




Question 14.
A school stores student test scores in a database. Which question can be answered using ONLY the stored data?




Question 15.
What is the MINIMUM number of bits needed to represent 50 unique values?




Question 16.
Which of the following is TRUE about packet switching on the Internet?




Question 17.
A program analyzes weather data and groups days into “hot,” “warm,” or “cold.” What is this an example of?




Question 18.
What is the result of the following code?

count ← 0
REPEAT 5 TIMES
{
    count ← count + 2
}
DISPLAY(count)



Question 19.
A heuristic algorithm is MOST useful when:




Question 20.
Which situation BEST demonstrates parallel computing?




Question 21.
A large dataset is being analyzed to determine average commute times in a city. Which computing innovation MOST helps make this analysis possible?




Question 22.
Which example BEST demonstrates how redundancy improves Internet reliability?




Question 23.
A programmer writes a procedure that removes all even numbers from a list. What programming concept does this illustrate?




Question 24.
What is the value of x after the following code executes?

x ← 1
REPEAT 4 TIMES
{
    x ← x * 3
}



Question 25.
Which scenario BEST illustrates how metadata is used?




Question 26.
A programmer wants to test only parts of a large program at a time. Which practice BEST supports this?




Question 27.
Which statement about lossless compression is TRUE?




Question 28.
A company collects user browsing data to recommend products. Which statement describes a POTENTIAL harm?




Question 29.
Consider the code:

count ← 0
i ← 1
REPEAT UNTIL (i > 6)
{
    count ← count + i
    i ← i + 2
}
DISPLAY(count)
What is displayed?


Question 30.
A team of students collaborates on a program. Which practice MOST supports successful collaboration?




Question 31.
Which action BEST protects against brute-force password attacks?




Question 32.
Which problem is MOST likely undecidable?




Question 33.
What is the primary purpose of using libraries in programs?




Question 34.
A student wants to determine whether there is a pattern between rainfall and crop growth. What computing practice is MOST relevant?




Question 35.
Consider:

nums ← [5, 2, 10, 1]
max ← nums[1]
FOR EACH n IN nums
{
    IF (n > max)
    {
        max ← n
    }
}
What is the final value of max?


Question 36.
Which of the following is a characteristic of parallel computing?




Question 37.
A weather app predicts the chance of rain by using historical data and a simulation model. Which statement is TRUE?




Question 38.
Which is the BEST example of an abstraction?




Question 39.
A social media site stores users’ posts, timestamps, and likes. Which question CANNOT be answered using only this data?




Question 40.
Which of the following Internet protocols ensures that packets are reliably delivered?




Question 41.
Which situation BEST illustrates a harmful effect of a computing innovation?




Question 42.
A program uses the following loop:

x ← 2
REPEAT UNTIL (x ≥ 50)
{
    x ← x * 2
}
DISPLAY(x)
What is displayed?


Question 43.
Which of the following BEST describes Moore’s Law?




Question 44.
Which activity is MOST likely to expose a user to a phishing attack?




Question 45.
Consider the list [4, 7, 2, 8]. What is displayed?

total ← 0
FOR EACH value IN list
{
    IF (value MOD 2 = 0)
    {
        total ← total + value
    }
}
DISPLAY(total)



Question 46.
A video streaming service compresses files before sending them. Which is a consequence of using **lossy** compression?




Question 47.
A user wants to ensure that messages they send cannot be read by anyone except the intended recipient. Which method BEST supports this?




Question 48.
Which is a TRUE statement about algorithms?




Question 49.
A company stores customer data and wants to reduce the risk of unauthorized access. Which action is MOST effective?




Question 50.
Which of the following is an advantage of using APIs?




Question 51.
Which situation BEST illustrates the use of machine learning?




Question 52.
A list contains the values [1, 2, 3, 4, 5]. What is displayed?

count ← 0
FOR i ← 1 TO 5
{
    IF (list[i] MOD 2 = 1)
    {
        count ← count + 1
    }
}
DISPLAY(count)



Question 53.
Which statement about crowdsourcing is TRUE?




Question 54.
Which of the following BEST demonstrates data aggregation?




Question 55.
Which statement is TRUE about parallel and sequential computing?




Question 56.
Which situation BEST demonstrates the use of a heuristic?




Question 57.
Which is an example of a computing innovation with both beneficial and harmful effects?




Question 58.
Consider the code segment:

x ← 10
y ← 0
WHILE (x > 1)
{
    y ← y + 1
    x ← x / 2
}
DISPLAY(y)
What is displayed?


Question 59.
Which of the following is TRUE about how the Internet scales?




Question 60.
Which of the following BEST illustrates sequencing?




Question 61.
What is the main advantage of scalable systems?




Question 62.
A teacher records the following data for each assignment: student name, score, submission date. Which question CANNOT be answered using only this data?




Question 63.
A researcher uses a simple model to simulate disease spread. What is a limitation of this approach?




Question 64.
Which is the value of result?

result ← 1
FOR i ← 1 TO 4
{
    result ← result + (i * 2)
}
DISPLAY(result)



Question 65.
Which statement BEST describes data compression?




Question 66.
What is MOST likely to improve the efficiency of a search algorithm?




Question 67.
A program counts how many words in a list begin with the letter "A". What type of operation is this?




Question 68.
Which situation BEST shows the concept of fault tolerance?




Question 69.
Which describes an advantage of distributing tasks across multiple processors?




Question 70.
Which question can be answered by analyzing a large dataset of streaming service activity?




AP CSP Practice Exam FAQ

Is this AP Computer Science Principles practice exam free?

Yes — this is a completely free 70-question AP CSP practice test with auto-grading and detailed explanations.

How accurate is the AP CSP score estimate?

The estimated AP score is based on typical AP CSP scoring distributions and provides a realistic benchmark for students.

What units or topics does this AP CSP practice test cover?

This exam covers algorithms, programming, data, the Internet, cybersecurity, abstraction, simulation, and global impacts.

Can teachers use this AP CSP practice test in class?

Yes — teachers are encouraged to use this exam for classroom review, test prep, or assessment.

Contact form