AP COMPUTER SCIENCE · CODE, DATA, SYSTEMS, AND IMPACT

AP Computer Science Practice Test

Build AP Computer Science readiness with five focused practice sets combining AP Computer Science A Java programming with the current 2026–27 AP Computer Science Principles framework: objects, control, classes, collections, data, algorithms, networks, security, impact, and responsible computing.

AP Computer Science practice sets

College Board offers separate AP Computer Science A and AP Computer Science Principles courses. This supplemental page brings both tracks together in five practice sets: three Java-focused CSA booklets and two current-framework CSP booklets.

CSA and CSP skills

  • AP Computer Science A Units 1–4: using objects and methods; selection and iteration; class creation; data collections including ArrayList and two-dimensional arrays
  • AP Computer Science A practices: design code, develop code, analyze code, and document code and computing systems
  • AP Computer Science Principles Big Ideas 1–5: creative development; data; algorithms and programming; computer systems and networks; and impact of computing
  • AP Computer Science Principles practices: computational solution design, algorithms and program development, abstraction, code analysis, computing innovations, and responsible computing
  • Code, binary, powers, indexes, and data calculations use the system’s supported notation where mathematical display is needed

How to use this page

For Java questions, trace types, references, method calls, control flow, indexes, and object state before choosing an answer. For CSP questions, identify the representation, abstraction, algorithm, network behavior, evidence, or social impact. These are original supplemental questions, not official College Board questions, secure exam content, Bluebook forms, or a substitute for current College Board policies.

The AP Computer Science A course page lists the current Java units and computational thinking practices. The AP Computer Science A exam page describes the current fully digital Java exam and Quick Reference. The AP Computer Science Principles course page lists the current 2026–27 Big Ideas and practices. The AP CSP exam page describes the current end-of-course exam and Create performance task.

College Board has announced an AP CSP redesign for 2027–28. This page targets the current 2026–27 AP CSP framework for the May 2027 administration; review the official redesign information before preparing for a later course year.

For additional preparation, visit AP Statistics Practice, AP Physics Practice, Computer Science and Technology Tests, or use Pomodoro for focused study intervals.

4. Test

AP Computer Science Practice Questions

A 10-question AP Computer Science practice set focused on ap computer science principles: creative development, data, and algorithms with original code, data, algorithms, and computing-impact explanations.

Trace code carefully, identify data representations and abstractions, evaluate algorithms and systems, and consider responsible computing impacts. Review the three-step explanation after answering. These questions are original supplemental practice, not official College Board questions.

10 Questions
0/100%
Reading settings
Reading settings
Text size
18px
Line spacing
1.70
C 0I 0U 10
1. QuestionMultiple choice

How many different values can be represented using exactly 8 binary bits?

Please select an answer first.

Correct answer: D

The correct answer is 28=2562^8=256.

  1. Trace the program or computing system: Identify the data, variables, objects, control flow, abstraction, network layer, or social impact described in the question.
  2. Apply the computer science principle: Each of 8 bits has 2 possible values, so the number of combinations is 28=2562^8=256.
  3. Check the result and assumptions: Check types, indexes, order of execution, boundary cases, representation, privacy, reliability, and whether the conclusion follows from the evidence.

Each of 8 bits has 2 possible values, so the number of combinations is 28=2562^8=256.

2. QuestionMultiple choice

Lossless compression is preferred when

Please select an answer first.

Correct answer: A

The correct answer is the original data must be reconstructed exactly.

  1. Trace the program or computing system: Identify the data, variables, objects, control flow, abstraction, network layer, or social impact described in the question.
  2. Apply the computer science principle: Lossless compression preserves enough information to reconstruct the original data exactly.
  3. Check the result and assumptions: Check types, indexes, order of execution, boundary cases, representation, privacy, reliability, and whether the conclusion follows from the evidence.

Lossless compression preserves enough information to reconstruct the original data exactly.

3. QuestionMultiple choice

An abstraction in a program is useful because it

Please select an answer first.

Correct answer: B

The correct answer is hides implementation details while exposing a manageable way to use a component.

  1. Trace the program or computing system: Identify the data, variables, objects, control flow, abstraction, network layer, or social impact described in the question.
  2. Apply the computer science principle: Abstraction reduces complexity by allowing a programmer to use a component through an interface without tracking every implementation detail.
  3. Check the result and assumptions: Check types, indexes, order of execution, boundary cases, representation, privacy, reliability, and whether the conclusion follows from the evidence.

Abstraction reduces complexity by allowing a programmer to use a component through an interface without tracking every implementation detail.

4. QuestionMultiple choice

An algorithm is considered correct when it

Please select an answer first.

Correct answer: C

The correct answer is produces the specified result for all valid inputs.

  1. Trace the program or computing system: Identify the data, variables, objects, control flow, abstraction, network layer, or social impact described in the question.
  2. Apply the computer science principle: Correctness depends on meeting the specification across the valid input space, not merely matching one example.
  3. Check the result and assumptions: Check types, indexes, order of execution, boundary cases, representation, privacy, reliability, and whether the conclusion follows from the evidence.

Correctness depends on meeting the specification across the valid input space, not merely matching one example.

5. QuestionMultiple choice

A loop that continues until a condition is false demonstrates

Please select an answer first.

Correct answer: D

The correct answer is iteration.

  1. Trace the program or computing system: Identify the data, variables, objects, control flow, abstraction, network layer, or social impact described in the question.
  2. Apply the computer science principle: Iteration repeats a block of instructions, often while or for a condition controls how long the repetition continues.
  3. Check the result and assumptions: Check types, indexes, order of execution, boundary cases, representation, privacy, reliability, and whether the conclusion follows from the evidence.

Iteration repeats a block of instructions, often while or for a condition controls how long the repetition continues.

Numicorn

A Numicorn tip

Share it and study together

Share the page with a friend, solve questions together and keep moving forward.

6. QuestionMultiple choice

Packet switching on the Internet improves resilience because

Please select an answer first.

Correct answer: A

The correct answer is data can be divided into packets and routed through different paths.

  1. Trace the program or computing system: Identify the data, variables, objects, control flow, abstraction, network layer, or social impact described in the question.
  2. Apply the computer science principle: Packet switching allows packets to travel through available routes and be reassembled at the destination.
  3. Check the result and assumptions: Check types, indexes, order of execution, boundary cases, representation, privacy, reliability, and whether the conclusion follows from the evidence.

Packet switching allows packets to travel through available routes and be reassembled at the destination.

7. QuestionMultiple choice

The Domain Name System primarily translates

Please select an answer first.

Correct answer: B

The correct answer is human-readable domain names into IP addresses.

  1. Trace the program or computing system: Identify the data, variables, objects, control flow, abstraction, network layer, or social impact described in the question.
  2. Apply the computer science principle: DNS helps users reach networked resources by mapping domain names to numerical IP addresses.
  3. Check the result and assumptions: Check types, indexes, order of execution, boundary cases, representation, privacy, reliability, and whether the conclusion follows from the evidence.

DNS helps users reach networked resources by mapping domain names to numerical IP addresses.

8. QuestionMultiple choice

A public-key encryption system can allow secure communication because

Please select an answer first.

Correct answer: C

The correct answer is a public key can encrypt information while a corresponding private key is kept secret for decryption.

  1. Trace the program or computing system: Identify the data, variables, objects, control flow, abstraction, network layer, or social impact described in the question.
  2. Apply the computer science principle: Public-key systems use related keys so the public key can be shared while the private key remains protected.
  3. Check the result and assumptions: Check types, indexes, order of execution, boundary cases, representation, privacy, reliability, and whether the conclusion follows from the evidence.

Public-key systems use related keys so the public key can be shared while the private key remains protected.

9. QuestionMultiple choice

Distributed computing can speed up a task when

Please select an answer first.

Correct answer: D

The correct answer is independent parts of the task are processed by multiple connected computers.

  1. Trace the program or computing system: Identify the data, variables, objects, control flow, abstraction, network layer, or social impact described in the question.
  2. Apply the computer science principle: Distributed systems divide suitable work across multiple computers, although communication and coordination introduce overhead.
  3. Check the result and assumptions: Check types, indexes, order of execution, boundary cases, representation, privacy, reliability, and whether the conclusion follows from the evidence.

Distributed systems divide suitable work across multiple computers, although communication and coordination introduce overhead.

10. QuestionMultiple choice

A development team repeatedly tests a prototype, gathers user feedback, and revises the design. This process best illustrates

Please select an answer first.

Correct answer: A

The correct answer is iterative and collaborative program development.

  1. Trace the program or computing system: Identify the data, variables, objects, control flow, abstraction, network layer, or social impact described in the question.
  2. Apply the computer science principle: Iteration and collaboration use testing and feedback to refine a computational solution toward its purpose.
  3. Check the result and assumptions: Check types, indexes, order of execution, boundary cases, representation, privacy, reliability, and whether the conclusion follows from the evidence.

Iteration and collaboration use testing and feedback to refine a computational solution toward its purpose.

Numicorn

A Numicorn tip

Share it and study together

Share the page with a friend, solve questions together and keep moving forward.

Test solutions

Review every solution on this page in one place.

Choose your next study path

Frequently asked questions about AP Computer Science Practice

What does this AP Computer Science page cover?

It combines three AP Computer Science A Java practice sets with two current AP Computer Science Principles practice sets covering code, objects, control, collections, data, algorithms, networks, security, computing impact, and responsible computing.

Are AP Computer Science A and AP Computer Science Principles the same exam?

No. They are separate College Board courses and exams. This page is a combined supplemental hub, and each booklet identifies whether it focuses on CSA or CSP.

What is the current AP Computer Science A exam structure?

For the May 2027 administration, the College Board describes a fully digital exam with 42 multiple-choice questions in 90 minutes and 4 Java free-response questions in 90 minutes: methods and control, class design, ArrayList data analysis, and two-dimensional arrays.

What is the current AP Computer Science Principles assessment?

The current AP CSP assessment combines a Create performance task with an end-of-course digital exam. The 2026–27 exam page describes 70 multiple-choice questions in 120 minutes plus two written-response questions connected to the student’s Create project.

Will AP Computer Science Principles change?

College Board has announced a redesign for the 2027–28 school year. This page targets the current 2026–27 framework and May 2027 administration; check official College Board updates for later years.

Are these official College Board questions?

No. They are original supplemental questions. Use College Board resources for the Java Quick Reference, Create task requirements, Bluebook previews, scoring, and administration details.