wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

AP CSP Practice Exam

Total questions: 65

Worksheet time: 2hrs 11mins

Name
Class
Date
1.
a)

Task A

b)

Task B

c)

Task C

d)

Task D

2.
a)

resultList contains all items from inputList that did not meet the Mystery condition

b)

resultList is always an empty list

c)

resultList contains all items from inputList that met the Mystery condition

d)

resultList always contains all items from inputList

3.
a)
b)
c)
d)
4.

Why is it important to focus on programming style in addition to programming functionality?

I) Program style helps others understand your program and maintain it

II) Programming style only applies to certain programming languages

III) Programming style increases the reusability of your code

a)

Only I

b)

I and II

c)

I and III

d)

II and III

5.

What ASCII character is represented by the binary (base 2) number 1010001?

a)

S

b)

P

c)

Q

d)

R

6.
a)

No change. This code works

b)

Change line 6 to num ← max

c)

Change line 1 to max ← list[1]

d)

Change line 4 to IF (num ≥ max)

7.
a)
b)
c)
d)
8.

What is the purpose of the Digital Millennium Copyright Act?

a)

To make all content on the Internet free for everyone to use.

b)

To allow for open source software on the Interne

c)

To criminalize plagiarism on the Internet.

d)

To criminalize the act of circumventing, or getting around, access controls that block access to copyrighted works.

9.
a)

Which users post messages most frequently?

b)

What time of day is the site most active?

c)

Which posts from a particular user have received the greatest number of comments?

d)

In what country is the site most active?

10.
a)

Returns the remainder of number divided by 2

b)

Returns whether or not number is even

c)

Returns number divided by 2

d)

Returns whether or not number is equal to 0

11.

Which of the following activities poses the LEAST potential cybersecurity risk?

a)

Clicking on a link in an email from an unknown sender

b)

Sharing your device’s private key used for encryption

c)

Sharing your device’s public key used for encryption

d)

Using a credit card to make an online purchase on a website that does not use encryption

12.
a)

resultList is always an empty list

b)

resultList always contains all items from inputList

c)

esultList contains all items from inputList that met the Mystery condition

d)

resultList contains the result of calling the Mystery procedure on every item in inputList

13.

Question 13: Which of the following activities poses the greatest personal cybersecurity risk?

a)

Entering your password to login to a Web site encrypted over HTTPS

b)

Emailing your bank account number to an online vendor to purchase a product from them

c)

Providing your email address when taking an online survey

d)

Downloading a free text editor program on the Internet

14.
a)

Algorithm A always calculates the correct answer, but Algorithm B does not.

b)

Algorithm B always calculates the correct answer, but Algorithm A does not.

c)

Both Algorithm A and Algorithm B always calculate the correct answer.

d)

Neither Algorithm A nor Algorithm B calculates the correct answer.

15.

Question 15: Which of the following statements describes a limitation of using a heuristic approach to solve a problem?

a)

A heuristic approach can only provide an approximate solution, rather than an exact solution

b)

Heuristic approaches cannot be run in a reasonable amount of time

c)

Heuristic approaches only run on very powerful computers that are not available to the general public

d)

Using heuristics generally increases the time it takes for an algorithm to run

16.

Question: 16

We want to create an algorithm called swapValues. Given two variables x and y the result should have the values of x and y swapped. Which of the following algorithms correctly swaps the values of x and y?

a)
b)
c)
d)
17.

Question: 17

The figure below represents a network of physically linked computers labeled A through F. A line between two computers indicates that the computers can communicate directly with each other. Any information sent between two computers that are not directly connected must go through at least one other computer. For example, information can be sent directly between computers A and B, but information sent between computers A and C must go through other computers.

Which of the following statements are true about this network:

I - The network is fault tolerant. If a single connection fails, any two devices can still communicate.

II - Computers B and F need to first communicate with at least one other device in order to communicate with each other.

a)

I only

b)

II only

c)

I and II

d)

Neither I nor II

18.

Computers are often used to search through large sets of data to find useful patterns in the data.

Which of the following tasks is an example where searching for patterns is needed to produce useful information?

a)

A high school searching over student GPAs to identify the student with the highest GPA

b)

A grocery store searching over its inventory to determine which items are running low

c)

A music application searching over a user’s library to determine if a particular song exists

d)

An online retail store analyzing customers’ viewing habits to suggest other products based on the purchasing history of other customers

19.

Question: 19

A bank uses a computer program during the night to tell if the alarm should be rung. Sensors in the bank set the following Boolean variables:

vaultClosed: set to true if the bank vault is closed; otherwise false heardNoise: set to true if a microphone heard noise; otherwise false sawMovement: set to true if a camera saw movement in the bank; otherwise false

The automatic alarm should notify the police if there is noise and movement in the bank, or if the bank vault is open. Which of the following boolean expressions can be used in a selection statement to ring the alarm?

a)

NOT vaultClosed OR (heardNoise AND sawMovement)

b)

heardNoise AND vaultClosed

c)

NOT vaultClosed AND sawMovement

d)

heardNoise AND sawMovement

20.
a)

Return whether or not word is in list

b)

Return the index of word in list

c)

Display true for each occurrence of word in list

d)

Display the index of word in list

21.
a)

How many new birds were born into the group during the month of July?

b)

In what month do the birds tend to travel the farthest?

c)

Do the migration patterns of the birds vary according to weather?

d)

What is the most common cause of death for this group of birds?

22.

Question: 22

A program is expressed in a programming language. Which of the following is true of the program?

a)

The program can also be expressed as binary code, but this increases the likelihood of errors

b)

The program can also be expressed as binary code, which is what the program will be translated to in order to execute on the computer

c)

The program cannot be expressed as binary code

d)

Some parts of the program can be expressed as binary code, but most features of programming languages cannot be translated to binary code.

23.
a)

Which college has the highest number of female computer science majors?

b)

How many states have computer science as the most common major for female students?

c)

Do students attending college in the United States tend to have higher grade point averages than students in other countries?

d)

Which state has the highest graduation rate for computer science majors?

24.

Question: 24

The figure below represents a network of physically linked computers labeled A through F. A line between two computers indicates that the computers can communicate directly with each other. Any information sent between two computers that are not directly connected must go through at least one other computer. For example, information can be sent directly between computers A and B, but information sent between computers A and C must go through other computers.

What is the minimum number of connections that must be broken or removed in the network before computer E can no longer communicate with computer F?

a)

1

b)

2

c)

3

d)

4

25.

Question: 25

A city government is attempting to reduce the digital divide between groups with differing access to computing and the Internet.

Which of the following actions is MOST likely to be effective in this purpose?

a)

Providing a way for citizens to vote online in local elections

b)

Providing free wireless Internet connections at locations in low-income neighborhoods

c)

Putting all government forms on the city Website

d)

Providing online basic computing classes for free

26.

Question 26: What does this flowchart algorithm display?

a)

?

b)

This flowchart program will error

c)

!

d)

Nothing

27.
a)

Switching line 3 and line 7

b)

Change line 3 to x ← y

c)

Remove the else statement and run line 7 no matter what

d)

Change line 3 to x ← -1 * y + x

28.

Question: 28

Which of the following programs is most likely to benefit from the use of a heuristic?

a)

A program that determines whether or not a given number exists in a list

b)

A program that sorts a list of numbers from least to greatest

c)

A program that counts the number of characters in an essay

d)

A program that computes the best move to play in a board game

29.

Question: 29

A Website is considering an update to its servers that would save the geolocations of users accessing the site. Which of the following is LEAST likely to occur as a result of this update?

a)

Privacy of users might be negatively affected.

b)

Storage requirements for the servers might increase.

c)

Users in a certain location may no longer be able to access the Website

d)

The Website may be able to provide content to its users that is relevant to their location

30.
a)

Karel Dog

b)

Tracy Turtle

c)

Tracy Dog

d)

Dog Turtle

31.
a)

This procedure returns the list without the first instance of the given target

b)

This procedure returns the list without any instance of the given target

c)

This procedure returns the list where each instance of the given target is replaced by the index.

d)

This procedure returns the number of times the target appears in the list

32.

Question: 32

Given the following algorithms, which one uses selection?

a)

Given a list of integers, display the length of the list.

b)

Given two numbers display the larger of the two.

c)

Given two numbers display the average of the two.

d)

Given a list of integers return the list in reverse order.

33.

Question: 33

What is the minimum number of bits you would need to represent a number on a 0 to 10 scale?

a)

1

b)

2

c)

4

d)

10

34.
a)

i ≥ 100

b)

counter > 10

c)

counter ≥ 10

d)

counter = i * 2

35.

Question: 35

A search engine has a trend-tracking feature that provides information on how popular a search term is. The data can be filtered by geographic region, date, and search term.

Which of the following questions is LEAST likely to be answerable using the trends feature?

a)

In what month does “swimming pool” receive the most searches?

b)

What region of the country has the greatest number of people searching for a certain musical artist?

c)

What region of the country has the highest population of a particular animal?

d)

When are flights to Hawaii likely to be the cheapest?

36.

Question: 36

Which of the following describes a limitation of cloud computing?

a)

Cloud computing is useful for individuals but not useful for businesses or governments

b)

Cloud computing has a negative effect on the scalability of systems

c)

Cloud computing has a negative effect on communication and collaboration among teams of people

d)

Storing data using cloud computing rather than storing on a personal computer may weaken the security of data

37.
a)

2 + 3 + x

b)

2 + (3 * x)

c)

2 * 3 * x

d)

3 + (2 * x)

38.
a)

The program will always display true

b)

The program will always display false

c)

The program could display either true or false

d)

The program will error

39.
a)

y * x

b)

y+x

c)

y / x

d)

y - x

40.
a)

This code displays the count of even numbers in list

b)

This code displays the sum of the even numbers in list

c)

This code displays the sum of the numbers at the even indices of list

d)

This code results in an error

41.
a)

I only

b)

I and II

c)

I and III

d)

I, II, and III

42.

Question: 42

Procedures A and B are meant to get the minimum value of a list of one or more integers. We have the two procedures below

a)

Procedure A returns the correct minimum value, but Procedure B does not.

b)

Procedure B returns the correct minimum value, but Procedure A does not.

c)

Both Procedure A and Procedure B display the correct minimum value.

d)

Neither Procedure A nor Procedure B returns the correct minimum value.

43.

Question: 43

Which of the following are true statements about phishing attacks?

I - Phishing attacks are characterized by communication from one person trying to trick another person into divulging personal information

II - Phishing attacks can be defended against using the DNS system

a)

I only

b)

II only

c)

Both I and II

d)

Neither I nor II

44.

Question: 44

Digital images are often represented by the red, green, and blue values (an RGB triplet) of each individual pixel in the image. A photographer is manipulating a digital image and overwriting the original image. Which of the following describes a lossy transformation of the digital image (a transformation in which information is lost and cannot be restored)?

a)

Creating the negative of an image by creating a new RGB triplet for each pixel in which each value is calculated by subtracting the original value from 255. The negative of an image is reversed from the original; light areas appear dark, and colors are reversed.

b)

Swapping the Red and Green values of each pixel so that areas that were red now appear green and vice versa.

c)

Creating a mirrored image by swapping the RGB values from pixels on the left side of an image with RGB values from pixels on the right side of an image.

d)

Creating the gray scale of an image by averaging the amounts of red, green, and blue in each pixel and assigning this new value to the corresponding pixel in the new image. The new value of each pixel represents a shade of gray, ranging from white to black.

45.
a)

Generally, as the size of songList becomes larger, Algorithm 1 will be more efficient than Algorithm 2

b)

Generally, as the size of songList becomes larger, Algorithm 2 will be more efficient than Algorithm 1

c)

In all cases, Algorithm 2 will always take less steps to find the target value than Algorithm 1

d)

In all cases, Algorithm 1 will always return the correct position

46.
a)
b)
c)
d)
47.
a)
b)
c)
d)

None of the above.

48.

Question: 48

Which of the following is true about why it is important to write clear function names?

a)

The name changes how the program functions.

b)

The name makes it clear what the purpose of the function is.

c)

The name allows you to translate the program into other languages.

d)

The name of a function is only used by the computer.

49.

Question: 49

Which of the following statements are true:

I - Every problem can be solved with an algorithm for all inputs, but some of these algorithms have not yet been discovered

II - Every problem can be solved with an algorithm for all inputs, but some problems cannot be solved in a reasonable amount of time

III - There exist problems that cannot be solved by any algorithm for all inputs

a)

I only

b)

II only

c)

III only

d)

I and II

50.
a)
b)
c)

Both of the above

d)

None of the above

51.

Question: 51

Which of the following statements describes an advantage of using a computer simulation to model a real-world object or system?

a)

Computer simulations model real-world objects and systems perfectly, without making any simplifying assumptions.

b)

Simulations allow us to test real-world events without the cost or danger of building and testing the phenomena in the real world.

c)

Computer simulations run very quickly, regardless of the level of detail of the model.

d)

Computer simulations are easy to debug.

52.
a)

Program 1 displays the correct average, but Program 2 does not

b)

Program 2 displays the correct average, but program 1 does not.

c)

Both program 1 and program 2 display the correct average.

d)

Neither program 1 nor program 2 displays the correct average.

53.
a)

If the initial value of number is 1, the procedure never begins.

b)

The return value will always be greater than the initial value of number

c)

The return value will be a positive integer greater than or equal to the initial value of number

d)

The return value will be a prime number greater than or equal to the initial value of number

54.
a)

x + 5

b)

x / 5

c)

x - 5

d)

x * 5

55.
a)

(num < 0) AND (num * -1 = 10)

b)

(num < -10) OR (num = -10)

c)

(num * -1 > 10) OR (num = -10)

d)

NOT num * -1 < 10

56.
a)

2

b)

3

c)

4

d)

5

57.
a)

The program correctly displays the count of even numbers between 1 and number

b)

The program does not work as intended because it displays the count of odd numbers between 1 and number

c)

The program does not work as intended because it displays count but should instead display i

d)

The program does not work as intended because the condition in the if statement needs to say (number MOD 2 = 0)

58.

Question: 58

A byte is made up of 8 bits (binary digits). You have a programming language that uses one byte to represent characters and are now modifying your language to use two bytes to represent characters. How many more characters can you represent in your new programming language?

a)

8 times as many characters

b)

282^8  as many characters

c)

828^2  as many characters

d)

2 times as many characters

59.
a)

i ← i MOD 2

b)

i ← i MOD 3

c)

i ← i MOD 4

d)

i ← i MOD 5

60.

Question: 60

When a cellular telephone sends a text message, the cell carrier encodes the text message and transmits the message to the receiving cellular telephone. The encoded text message is the data of the transmission.

In addition to transmitting the data, the cell carrier company also stores metadata. The metadata of the text message includes the time the message was sent, the phone number of the sender, and the phone number of the receiver.

For which of the following goals would it be more useful to computationally analyze the metadata instead of the data?

I. Estimate the number of texts that will be sent next month

II. Determine the most frequently used emoji in text messages

III. Determine if two phones have been in contact in the last week

a)

I only

b)

II only

c)

I and III

d)

I, II, and III

61.

Question: 61

A construction company is building a tall skyscraper and is considering two different types of material to use for the beams in the building. The company decides to use a computer simulation of each option to determine which material will cause the building to be more stable.

Which of the following is NOT true about the company’s plan?

a)

The company may consider new alternatives based on the simulation results

b)

The company can use the simulation to investigate these two options without ever building anything physical

c)

The simulation will not produce usable results because actual data about each material is not available

d)

The company can incorporate other factors, such as number of floors in the building, in the simulation.

62.

Question: 62

Which of the following is considered an unethical use of computer resources?

a)

Downloading shareware onto your computer

b)

Using an image on a website without giving credit to the original creator

c)

Using and citing open source code in a personal program

d)

Searching the Internet for an online stream of a copyrighted movie

63.

Question: 63

A researcher is emailing images of soil samples back to her lab so her team can analyze them. She notices that the images sent in her email are of lower quality than the images on her camera. Which of the following could be a possible explanation for the difference in image quality?

a)

Before being sent, the image was compressed using a lossless compression technique

b)

Before being sent, the image was compressed using a lossy compression technique

c)

Some information was lost due to network packets not reaching their final destination

d)

Before being sent, the image was encrypted using asymmetric encryption

64.

Question: 64

Which of the following is NOT a characteristic of the redundant nature of routing on the Internet?

a)

The existence of multiple paths between two addresses

b)

The ability to transmit data between two devices even when some connections in the network are broken

c)

The ability to reroute data when one connection is overloaded

d)

The ability to use a hierarchical naming system to avoid naming conflicts

65.

Question: 65

A video viewing Website previously used 32-bit integers to store the number of views for each video, but a video that had been watched billions of times hit the maximum value. What is it called when this maximum is exceeded?

a)

An overflow error

b)

A maximum error

c)

A kilobyte error

d)

A viewing error