NEW
Font size
WorksheetsAP CSP Practice Exam
Total questions: 65
Worksheet time: 2hrs 11mins
Task A
Task B
Task C
Task D
resultList contains all items from inputList that did not meet the Mystery condition
resultList is always an empty list
resultList contains all items from inputList that met the Mystery condition
resultList always contains all items from inputList
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
Only I
I and II
I and III
II and III
What ASCII character is represented by the binary (base 2) number 1010001?
S
P
Q
R
No change. This code works
Change line 6 to num ← max
Change line 1 to max ← list[1]
Change line 4 to IF (num ≥ max)
What is the purpose of the Digital Millennium Copyright Act?
To make all content on the Internet free for everyone to use.
To allow for open source software on the Interne
To criminalize plagiarism on the Internet.
To criminalize the act of circumventing, or getting around, access controls that block access to copyrighted works.
Which users post messages most frequently?
What time of day is the site most active?
Which posts from a particular user have received the greatest number of comments?
In what country is the site most active?
Returns the remainder of number divided by 2
Returns whether or not number is even
Returns number divided by 2
Returns whether or not number is equal to 0
Which of the following activities poses the LEAST potential cybersecurity risk?
Clicking on a link in an email from an unknown sender
Sharing your device’s private key used for encryption
Sharing your device’s public key used for encryption
Using a credit card to make an online purchase on a website that does not use encryption
resultList is always an empty list
resultList always contains all items from inputList
esultList contains all items from inputList that met the Mystery condition
resultList contains the result of calling the Mystery procedure on every item in inputList
Question 13: Which of the following activities poses the greatest personal cybersecurity risk?
Entering your password to login to a Web site encrypted over HTTPS
Emailing your bank account number to an online vendor to purchase a product from them
Providing your email address when taking an online survey
Downloading a free text editor program on the Internet
Algorithm A always calculates the correct answer, but Algorithm B does not.
Algorithm B always calculates the correct answer, but Algorithm A does not.
Both Algorithm A and Algorithm B always calculate the correct answer.
Neither Algorithm A nor Algorithm B calculates the correct answer.
Question 15: Which of the following statements describes a limitation of using a heuristic approach to solve a problem?
A heuristic approach can only provide an approximate solution, rather than an exact solution
Heuristic approaches cannot be run in a reasonable amount of time
Heuristic approaches only run on very powerful computers that are not available to the general public
Using heuristics generally increases the time it takes for an algorithm to run
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?
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.
I only
II only
I and II
Neither I nor II
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 high school searching over student GPAs to identify the student with the highest GPA
A grocery store searching over its inventory to determine which items are running low
A music application searching over a user’s library to determine if a particular song exists
An online retail store analyzing customers’ viewing habits to suggest other products based on the purchasing history of other customers
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?
NOT vaultClosed OR (heardNoise AND sawMovement)
heardNoise AND vaultClosed
NOT vaultClosed AND sawMovement
heardNoise AND sawMovement
Return whether or not word is in list
Return the index of word in list
Display true for each occurrence of word in list
Display the index of word in list
How many new birds were born into the group during the month of July?
In what month do the birds tend to travel the farthest?
Do the migration patterns of the birds vary according to weather?
What is the most common cause of death for this group of birds?
Question: 22
A program is expressed in a programming language. Which of the following is true of the program?
The program can also be expressed as binary code, but this increases the likelihood of errors
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
The program cannot be expressed as binary code
Some parts of the program can be expressed as binary code, but most features of programming languages cannot be translated to binary code.
Which college has the highest number of female computer science majors?
How many states have computer science as the most common major for female students?
Do students attending college in the United States tend to have higher grade point averages than students in other countries?
Which state has the highest graduation rate for computer science majors?
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?
1
2
3
4
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?
Providing a way for citizens to vote online in local elections
Providing free wireless Internet connections at locations in low-income neighborhoods
Putting all government forms on the city Website
Providing online basic computing classes for free
Question 26: What does this flowchart algorithm display?
?
This flowchart program will error
!
Nothing
Switching line 3 and line 7
Change line 3 to x ← y
Remove the else statement and run line 7 no matter what
Change line 3 to x ← -1 * y + x
Question: 28
Which of the following programs is most likely to benefit from the use of a heuristic?
A program that determines whether or not a given number exists in a list
A program that sorts a list of numbers from least to greatest
A program that counts the number of characters in an essay
A program that computes the best move to play in a board game
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?
Privacy of users might be negatively affected.
Storage requirements for the servers might increase.
Users in a certain location may no longer be able to access the Website
The Website may be able to provide content to its users that is relevant to their location
Karel Dog
Tracy Turtle
Tracy Dog
Dog Turtle
This procedure returns the list without the first instance of the given target
This procedure returns the list without any instance of the given target
This procedure returns the list where each instance of the given target is replaced by the index.
This procedure returns the number of times the target appears in the list
Question: 32
Given the following algorithms, which one uses selection?
Given a list of integers, display the length of the list.
Given two numbers display the larger of the two.
Given two numbers display the average of the two.
Given a list of integers return the list in reverse order.
Question: 33
What is the minimum number of bits you would need to represent a number on a 0 to 10 scale?
1
2
4
10
i ≥ 100
counter > 10
counter ≥ 10
counter = i * 2
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?
In what month does “swimming pool” receive the most searches?
What region of the country has the greatest number of people searching for a certain musical artist?
What region of the country has the highest population of a particular animal?
When are flights to Hawaii likely to be the cheapest?
Question: 36
Which of the following describes a limitation of cloud computing?
Cloud computing is useful for individuals but not useful for businesses or governments
Cloud computing has a negative effect on the scalability of systems
Cloud computing has a negative effect on communication and collaboration among teams of people
Storing data using cloud computing rather than storing on a personal computer may weaken the security of data
2 + 3 + x
2 + (3 * x)
2 * 3 * x
3 + (2 * x)
The program will always display true
The program will always display false
The program could display either true or false
The program will error
y * x
y+x
y / x
y - x
This code displays the count of even numbers in list
This code displays the sum of the even numbers in list
This code displays the sum of the numbers at the even indices of list
This code results in an error
I only
I and II
I and III
I, II, and III
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
Procedure A returns the correct minimum value, but Procedure B does not.
Procedure B returns the correct minimum value, but Procedure A does not.
Both Procedure A and Procedure B display the correct minimum value.
Neither Procedure A nor Procedure B returns the correct minimum value.
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
I only
II only
Both I and II
Neither I nor II
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)?
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.
Swapping the Red and Green values of each pixel so that areas that were red now appear green and vice versa.
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.
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.
Generally, as the size of songList becomes larger, Algorithm 1 will be more efficient than Algorithm 2
Generally, as the size of songList becomes larger, Algorithm 2 will be more efficient than Algorithm 1
In all cases, Algorithm 2 will always take less steps to find the target value than Algorithm 1
In all cases, Algorithm 1 will always return the correct position
None of the above.
Question: 48
Which of the following is true about why it is important to write clear function names?
The name changes how the program functions.
The name makes it clear what the purpose of the function is.
The name allows you to translate the program into other languages.
The name of a function is only used by the computer.
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
I only
II only
III only
I and II
Both of the above
None of the above
Question: 51
Which of the following statements describes an advantage of using a computer simulation to model a real-world object or system?
Computer simulations model real-world objects and systems perfectly, without making any simplifying assumptions.
Simulations allow us to test real-world events without the cost or danger of building and testing the phenomena in the real world.
Computer simulations run very quickly, regardless of the level of detail of the model.
Computer simulations are easy to debug.
Program 1 displays the correct average, but Program 2 does not
Program 2 displays the correct average, but program 1 does not.
Both program 1 and program 2 display the correct average.
Neither program 1 nor program 2 displays the correct average.
If the initial value of number is 1, the procedure never begins.
The return value will always be greater than the initial value of number
The return value will be a positive integer greater than or equal to the initial value of number
The return value will be a prime number greater than or equal to the initial value of number
x + 5
x / 5
x - 5
x * 5
(num < 0) AND (num * -1 = 10)
(num < -10) OR (num = -10)
(num * -1 > 10) OR (num = -10)
NOT num * -1 < 10
2
3
4
5
The program correctly displays the count of even numbers between 1 and number
The program does not work as intended because it displays the count of odd numbers between 1 and number
The program does not work as intended because it displays count but should instead display i
The program does not work as intended because the condition in the if statement needs to say (number MOD 2 = 0)
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?
8 times as many characters
28 as many characters
82 as many characters
2 times as many characters
i ← i MOD 2
i ← i MOD 3
i ← i MOD 4
i ← i MOD 5
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
I only
II only
I and III
I, II, and III
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?
The company may consider new alternatives based on the simulation results
The company can use the simulation to investigate these two options without ever building anything physical
The simulation will not produce usable results because actual data about each material is not available
The company can incorporate other factors, such as number of floors in the building, in the simulation.
Question: 62
Which of the following is considered an unethical use of computer resources?
Downloading shareware onto your computer
Using an image on a website without giving credit to the original creator
Using and citing open source code in a personal program
Searching the Internet for an online stream of a copyrighted movie
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?
Before being sent, the image was compressed using a lossless compression technique
Before being sent, the image was compressed using a lossy compression technique
Some information was lost due to network packets not reaching their final destination
Before being sent, the image was encrypted using asymmetric encryption
Question: 64
Which of the following is NOT a characteristic of the redundant nature of routing on the Internet?
The existence of multiple paths between two addresses
The ability to transmit data between two devices even when some connections in the network are broken
The ability to reroute data when one connection is overloaded
The ability to use a hierarchical naming system to avoid naming conflicts
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?
An overflow error
A maximum error
A kilobyte error
A viewing error
