Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

2025-2026 AP CSP Midterm Exam

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

Which of the following best describes an algorithm?

a)

A sequence of steps used to complete a task

b)

A variable that stores numerical information

c)

A block of code that repeats infinitely

d)

A diagram used only for debugging

2.

A student writes pseudocode before coding. What is the purpose of pseudocode?

a)

To verify syntax before running a program

b)

To express program ideas in a language-agnostic way

c)

To store variables and data values

d)

To automatically convert code into flowcharts

3.

Which situation demonstrates sequencing?

a)

A loop that repeats 10 times

b)

A program choosing between two branches

c)

A series of instructions executed in order

d)

An event triggered by a mouse click

4.

Consider the code segment: x = 5 x = x + 3 What is the value of x?

a)

3

b)

5

c)

8

d)

15

5.

A conditional is used in a program to:

a)

Organize data into a list

b)

Provide user input

c)

Select different actions based on a Boolean expression

d)

Repeat a block of code until stopped

6.

What is the value of count after this code runs? count = 0 REPEAT 3 TIMES: count = count + 2

a)

2

b)

4

c)

6

d)

8

7.

A student wants a procedure to reduce repeated code. This is an example of:

a)

Sequencing

b)

Abstraction

c)

Data compression

d)

Iteration

8.

What does the following procedure do? PROCEDURE triple(n) RETURN n * 3

a)

Divides input by 3

b)

Multiplies input by 3

c)

Adds 3 to input

d)

Prints the input

9.

What is the effect of a loop that never changes its Boolean condition?

a)

Infinite loop

b)

Syntax error

c)

Stops after 10 iterations

d)

Changes variable values automatically

10.

Which of the following is considered an event?

a)

Loop variable updating

b)

User clicking a turtle graphic

c)

Variable storing a list

d)

Program reaching the last line

11.

What type of data is stored in: name = "Jordan"?

a)

Boolean

b)

Number

c)

String

d)

List

12.

Which best describes a list?

a)

A single piece of data

b)

A collection of ordered values

c)

A Boolean expression

d)

A mathematical function

13.

What is `colors[1]` if `colors = ["red", "blue", "green"]`?

a)

red

b)

blue

c)

green

d)

error

14.

Which Python instruction increases `score` by 1?

a)

score = + 1

b)

score = score + score

c)

score += 1

d)

score = score - 1

15.

A Boolean variable stores:

a)

Only positive numbers

b)

True or False values

c)

Any type of list

d)

Only strings

16.

A program records distances from a sensor. What is the best structure to use?

a)

String

b)

Boolean

c)

List

d)

Procedure

17.

What is the output of `DISPLAY(animals[2])` if `animals = ["cat", "dog", "bird"]`?

a)

cat

b)

dog

c)

bird

d)

2

18.

What is an advantage of using a list?

a)

Prevents errors

b)

Automatically sorts

c)

Groups related data

d)

Runs faster than variables

19.

What is the output of the following code? `x = TRUE` `y = FALSE` `RETURN (x AND y)`

a)

TRUE

b)

FALSE

20.

Data abstraction is:

a)

Lowering resolution

b)

Removing data

c)

Hiding implementation details

d)

Compressing data

21.

A function helps programmers by:

a)

Slowing the program

b)

Reducing repeated code

c)

Preventing loops

d)

Increasing memory usage

22.

Correct function definition in pseudocode?

a)

FUNCTION move()

b)

start move:

c)

PROCEDURE(move)

d)

CALL move()

23.

Parameters allow functions to:

a)

Execute without user input

b)

Store lists

c)

Accept input values

d)

Avoid using variables

24.

PROCEDURE addOne(x) RETURN x + 1 addOne(4) returns:

a)

1

b)

3

c)

4

d)

5

25.

Scenario demonstrating abstraction:

a)

Manually writing every detail

b)

Using a function without knowing its internals

c)

Creating more complex functions

d)

Using descriptive names

26.

Best description of a computing innovation:

a)

A theoretical idea

b)

A new computing concept

c)

A practical application of computing

d)

A programming language

27.

Digital data is represented using:

a)

Text

b)

Bits

c)

Images only

d)

Colors

28.

Which of the following is a harmful impact of computing?

a)

Encryption

b)

Storing private data insecurely

c)

Using open-source software

d)

Compressing a file

29.

An autonomous robot in a factory is an example of:

a)

Event-driven programming

b)

Innovation with benefits and harms

c)

Data compression

d)

Boolean logic

30.

What is a beneficial impact of automation?

a)

Increased cyber attacks

b)

Job displacement

c)

Increased productivity

d)

Loss of data

31.

If x = 2, y = 3, and z = x * y + 1, what is the value of z?

a)

3

b)

5

c)

7

d)

9

32.

An infinite loop occurs when:

a)

Loop has a counter

b)

Condition never changes

c)

Loop runs 5 times

d)

Loop inside a function

33.

Using helper function to simplify code is:

a)

Decomposition

b)

Compression

c)

Iteration

d)

Event handling

34.

[72, 75, 80, 79, 70] is:

a)

Boolean

b)

List

c)

String

d)

Function

35.

num = 4 IF num > 2 THEN DISPLAY("High") ELSE DISPLAY("Low")

a)

2

b)

High

c)

Low

d)

Error

36.

Events are:

a)

Loop counters

b)

User/system triggers

c)

Impossible without lists

d)

Hardware only

37.

Function returning random color is example of:

a)

Procedural abstraction

b)

Data conversion

c)

Boolean logic

d)

Iteration

38.

Access last element of nums:

a)

nums[0]

b)

nums[-1]

c)

nums[last]

d)

nums[99]

39.

Hiding complexity inside function is:

a)

Compression

b)

Abstraction

c)

Iteration

d)

Simulation

40.

Repeat until condition false requires:

a)

Sequencing

b)

Conditionals

c)

Loop

d)

Boolean expression

41.

What are algorithms?

a)

A type of data structure

b)

Step-by-step instructions

c)

A programming language

d)

A type of loop

42.

What does pseudocode express?

a)

Syntax rules

b)

Logic without syntax

c)

Data types

d)

Programming errors

43.

What does sequencing mean in programming?

a)

Executing steps in order

b)

Repeating steps infinitely

c)

Choosing between paths

d)

Grouping related data

44.

What is the purpose of conditionals in programming?

a)

To repeat steps

b)

To choose between paths

c)

To group data

d)

To store values

45.

What happens when a condition in a loop remains unchanged?

a)

The loop stops

b)

The loop executes once

c)

The loop causes an infinite loop

d)

The loop skips steps

46.

What does abstraction help with in programming?

a)

Reducing repeated code

b)

Increasing complexity

c)

Storing data

d)

Triggering events

47.

What is the value of animals[2] if animals = ["cat", "dog", "bird"]?

a)

"cat"

b)

"dog"

c)

"bird"

d)

"fish"

48.

What does the keyword FUNCTION represent in programming?

a)

A variable

b)

A loop

c)

A function definition

d)

A conditional statement

49.

What does decomposition help with in problem-solving?

a)

Combining problems

b)

Breaking problems down

c)

Ignoring problems

d)

Solving problems directly

50.

What happens in a loop that never updates?

a)

It stops immediately

b)

It runs infinitely

c)

It skips iterations

d)

It produces errors