0% found this document useful (0 votes)
0 views

AP Computer Science Principles-EXAM1-5 Steps to a 5-MCQ

The AP Computer Science Principles Diagnostic Test consists of 70 multiple-choice questions, with a focus on various computer science concepts and practices. The test includes a reference sheet for use during the exam and emphasizes the importance of understanding procedures, algorithms, and data handling. It aims to assess knowledge crucial for the AP Computer Science Principles course and provides practice for students preparing for the actual exam.

Uploaded by

asmasaggaf24
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

AP Computer Science Principles-EXAM1-5 Steps to a 5-MCQ

The AP Computer Science Principles Diagnostic Test consists of 70 multiple-choice questions, with a focus on various computer science concepts and practices. The test includes a reference sheet for use during the exam and emphasizes the importance of understanding procedures, algorithms, and data handling. It aims to assess knowledge crucial for the AP Computer Science Principles course and provides practice for students preparing for the actual exam.

Uploaded by

asmasaggaf24
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

AP Computer Science Principles Diagnostic Test

Multiple-Choice Questions
ANSWER SHEET
AP Computer Science Principles Diagnostic Test
Multiple-Choice Questions

Time: 2 hours
Number of questions: 70
The multiple-choice questions represent 70% of your total score.

Directions: Choose the one best answer for each question. The last eight
questions have two correct answers; for these, you will be instructed to
choose two answer choices.

Tear out the answer sheet on the previous page and grid in your answers
using a pencil.

AP Computer Science Principles Exam Reference Sheet


On the AP Computer Science Principles exam, you will be given a
reference sheet to use while you’re taking the multiple-choice test. A
copy of this six-page reference sheet is included in the appendix of this
book (reprinted by permission from the College Board).
To make taking this practice test like taking the actual exam, tear out the
reference sheet so you can easily refer to it while taking the test. Save
these reference pages since you’ll need to use them when you take AP
Computer Science Principles Practice Exams 1 and 2 at the end of this
book. If you misplace the Exam Reference Sheet, you can print another
copy located at the end of the Student Handouts document:
https://apcentral.collegeboard.org/pdf/ap-csp-student-task-directions.pdf?
course=ap-computer-science-principles.

1. How are procedures abstract in computer science?


(A) They are blocks of code that do something specific.
(B) They represent the lowest level of code for the computer to run.
(C) They use actual values to represent concepts.
(D) They can be used without understanding or seeing the code used.
2. What do parameters used in a procedure provide?
(A) They allow software reuse for different values.
(B) They return calculated values from the procedure to the calling
program.
(C) They provide a way to call a procedure from within another
procedure.
(D) They provide the connection of an API to the procedure.
3. What happens when you “clean data”?
(A) Corrupt data records are corrected or removed.
(B) Incomplete data records are completed or removed.
(C) Duplicate records are removed.
(D) All of the above.
4. What causes an algorithm to be considered one that runs in an
unreasonable amount of time?
(A) The solution is too inefficient for large datasets.
(B) There is not an algorithm that can solve it.
(C) It is solved most efficiently with large datasets.
(D) Multiple algorithms exist with different levels of efficiency.
5. What are statements, procedures, and libraries examples of?
(A) Low-level machine code that the computer uses to run the code
(B) Abstractions used in writing software because they can be used
without knowing the details of how they work
(C) Algorithms that provide suggestions on how to approach writing
the code to solve a problem
(D) Pseudocode that helps design a solution for coding challenges
6. What is an issue that organizations must handle when dealing with
datasets?
(A) Ensuring that enough staff are on hand to process the data
(B) Ensuring that the bandwidth can handle the processing of the data
(C) Ensuring that people’s private data is not exposed
(D) Ensuring that the system can scale down after the data are sent to
the cloud
7. How does the Internet work with the different equipment in use?
(A) The routers adjust for the different equipment manufacturers by
sending data on the same equipment brands.
(B) Specific companies are approved to make equipment for the
Internet.
(C) Vendors follow the protocols established to enable data to be sent
and received across any equipment.
(D) The server farms handle the data once the data reach the Regional
ISP (Internet Service Provider).
8. What is the binary equivalent of the decimal number 158?
(A) 10011111
(B) 10011110
(C) 10011101
(D) 10011000
9. How do selection statements determine which section of code to
execute?
(A) Through the use of the Turing algorithm for analysis
(B) Through random number generators
(C) Through conditions that evaluate to true or false
(D) Through variables initialized to execute these statements
10. You are writing a program to help the school assign lockers each year.
You have a list of student names and a separate list of locker numbers.
The locker numbers match the index position for the list. Assume the
lists are correctly initialized. What can replace <missing code> to
assign the student to the next available locker?
(A) lockerNum ← name
(B) lockerNum[index] ← name
(C) students ← lockerNum
(D) students[index] ← lockerNum
11. What do logical conditions always evaluate to?
(A) A Boolean value
(B) A value stored in a constant
(C) A “string” text field
(D) A real number
12. What is the process where algorithms are used with historical data to
attempt to predict human needs or requests for information?
(A) Data excavation
(B) Trend prediction
(C) Social analysis
(D) Machine learning
13. What would be the starting and ending index positions for the substring
function to extract everything up to but not including the “@” if you
are given the following string: [email protected]?
(A) 0, 5
(B) 0, 6
(C) 1, 6
(D) 1, 7
14. How is analog data converted to digital data?
(A) The analog curve is extrapolated and converted into x, y
coordinate values.
(B) The analog data values are converted precisely to digital data.
(C) Samples of the analog data are taken and converted to bits.
(D) Samples of the analog data are approximated to mimic the smooth
curve.
15. How do APIs simplify writing programs?
(A) By providing step-by-step instructions on how to use the
programming language
(B) By importing the newly written software to the API for others to
use
(C) By providing documentation on how to code the needed
functionality
(D) By connecting prewritten and tested software to a new program
16. While algorithms can be analyzed mathematically, what information
does the testing process provide?
(A) How often program statements execute
(B) The maximum size dataset the algorithm can handle
(C) The validity of the algorithm
(D) The clarity of the algorithm
17. Why is there a need to find different algorithms for problems that
already have a solution?
(A) Different algorithms could use heuristics rather than precise
values.
(B) Different algorithms could be more efficient.
(C) Different algorithms could use frequency analysis.
(D) Different algorithms could provide intractability.
18. Algorithms can be written with a combination of what three
statements?
(A) Sequence / Selection / Iteration
(B) Series / Procedural / Functional
(C) Connection / Collection / Recursive
(D) Selection / Sorting / Searching
19. What is the most common way computer viruses are spread?
(A) By people clicking on an infected file
(B) From phishing attacks
(C) Through a rogue access point
(D) From random botnet attacks
20. Different levels of access to technological devices and the Internet due
to economic or geographic reasons is referred to as:
(A) Binary split
(B) Demographic division
(C) Digital divide
(D) Technology rift
21. How does creating program components help with program
development?
(A) Individual components can be added without additional testing.
(B) Adding tested components incrementally to working code helps
create program functionality that is correct.
(C) Multiple people can write the components and still ensure
compatibility.
(D) The components can be combined all at once to create the needed
program functionality.
22. What is the name of the search method that provides higher or lower
feedback with each iteration of the search?
(A) Bucket search
(B) Merge search
(C) Linear search
(D) Binary search
23. How does documentation help with maintaining programs?
(A) It journals the history of program changes, showing how the
program first worked before changes.
(B) If code is modified, the documentation can guide the programmer
in testing to ensure the functionality is still correct.
(C) It documents how to run the program in multiple languages for a
global audience.
(D) It is useful for training new employees on how to learn the
programming language.
24. Parallel computing consists of what two parts?
(A) A sequential section and a parallel section
(B) A parallel section and a distributed section
(C) A sequential section and a distributed section
(D) A sequential section and an iterative section
25. What could a binary number represent?
(A) A number in decimal
(B) A color
(C) Text
(D) All of the above
26. How can programmers avoid duplicating code?
(A) Through the use of selection statements
(B) Through the use of iteration
(C) Through sequential statements to process all data once
(D) Through the use of efficient algorithms
27. What is a problem that no algorithm exists to solve all instances called?
(A) Indeterminable problem
(B) Undecidable problem
(C) Infinite problem
(D) Exponential problem
28. Why should procedures be used?
(A) They ease the workload on the processors.
(B) They facilitate the storage of data.
(C) They make writing and maintaining programs easier through reuse
of code.
(D) They control the flow of input and output data.
29. What can help with identifying and correcting program errors?
(A) Revisiting requirements
(B) Collaboration among team members
(C) Clustering requirements and tests
(D) Consolidating testing
30. How can financial transactions safely occur on the Internet?
(A) Through the use of symmetric keys
(B) Through certificates issued by Certificate Authorities (CAs) that
validate the keys used
(C) Through the use of double authentication methods
(D) Through the use of frequency analysis
31. What is the definition of bandwidth?
(A) The frequency at which data can be transmitted across the Internet
(B) The speed at which data can be sent through the Internet
(C) The amount of data that can be transmitted in a fixed amount of
time
(D) The delay between the request and the receipt of information on
the Internet
32. Which type of loop is most effective to iterate over a list?
(A) Traversal loop
(B) REPEAT UNTIL
(C) FOR EACH
(D) REPEAT n TIMES
33. What is one way to help ensure the correctness of algorithms?
(A) By testing with small sets of expected data
(B) Through reuse of existing correct algorithms to build new
algorithms
(C) Through documenting the functionality of the algorithm
(D) Through the use of heuristic algorithms
34. You are helping write the code to register students for classes. What can
replace <missing code> to make the program work? Assume all
variables are initialized correctly.
(A) desks = 25
(B) desks < 0
(C) desks = 0
(D) LENGTH (classRoster) = 0
35. An error that produces incorrect results is what type of error?
(A) Syntax error
(B) Runtime error
(C) Overflow error
(D) Logic error
36. Why is it important to write programs that are readable?
(A) They are easier to modify and debug.
(B) They run more efficiently.
(C) They effectively process all cases of input.
(D) They produce accurate results.
37. How is collaboration useful in defining requirements?
(A) The multiple viewpoints can provide several outcomes for the
program.
(B) Applying differing experiences and skills provides better
identification, analysis, and program development to meet
requirements.
(C) The analysis can be divided among several people, speeding up
the development process.
(D) Having multiple perspectives helps the group form alliances
among the team members.
38. When would lossless data compression be preferred over a lossy one?
(A) When you need to restore the original file
(B) When the level of compression is more important than restoring to
the original file
(C) When you need to display the file on mobile devices and websites
(D) When you have limited space available on your computer
39. How does the Internet process transactions securely?
(A) The public key encryption model is easy to use to encrypt data but
intractable for decrypting.
(B) Frequency analysis is used to disguise the use of common letters
in encrypted messages, which keeps passwords secure.
(C) Symmetric keys are used to encrypt and decrypt messages for
speed in processing to avoid interception.
(D) Multiple alphabets are used to encrypt and decrypt messages to
allow for use with different languages.
40. When does an overflow error occur?
(A) When a program exceeds the limit of lines of code for a
programming language
(B) When the lines of output exceed the programming language limit
(C) When a “divide by zero” condition occurs
(D) When an integer needs more bits than are available to represent it
41. Why are simulations useful abstractions?
(A) They can test hypotheses without real-world constraints.
(B) They can change multiple options at the same time, leading to
new insights.
(C) They can precisely test real-world events to identify the ultimate
outcome.
(D) They can confirm the cause of events.
42. What is one way that data can be intercepted over a public network?
(A) A router
(B) A successful phishing attempt
(C) Keylogging software
(D) A rogue access point
43. What is an example of lower-level abstractions combining to make
higher-level abstractions?
(A) Dividing functionality into separate modules that are all part of
one program
(B) Writing pseudocode to identify what the program needs to do
(C) Creating help documentation so the user will know how to use the
program
(D) Using a flowchart to identify program decisions
44. How is the Internet scalable?
(A) Through the ability for additional networks and routers to be
added without impacting service
(B) Through the ability to add longer public keys to keep data secure
(C) Through the ability to add additional authentication for users
(D) Through the ability to add additional bandwidth to requests
45. Having your personally identifiable information (PII) stored online
enhances your online experience with making online purchases, filling
out forms, and other uses. A risk is that your PII data could be
vulnerable to exposure through hacking or accidental disclosure.
Which piece of information is classified as PII?
(A) Zip code
(B) Internet search history
(C) Language preference
(D) Time zone

Questions 46–50.
A GPS company is developing a new software app called “Find my car!” to
work with self-driving vehicles. If you cannot remember where you parked
your vehicle, or it’s raining when you are leaving a location, you can press a
button on an app to summon your vehicle. The self-driving car will exit its
parking spot and drive to your GPS location for you to enter the vehicle.
Here is a flowchart of the process.
46. Is this a computing innovation? Why or why not?
(A) A computer program is not needed, so the app is not a computing
innovation.
(B) The programming is completed by the GPS satellite, not this
innovation, so the app is not a computing innovation.
(C) The programming is controlled by the self-driving car’s
manufacturer, so the app is not a computing innovation.
(D) The app sends GPS coordinates to the vehicle, along with the
signal to drive to the location, so the app is a computing
innovation.
47. What output does the app produce?
(A) Instructions to start the vehicle and drive to the coordinates
provided
(B) The button event to be pressed
(C) A signal to the GPS satellites to send current location coordinates
(D) Directions to get from the parking spot to the current location
48. What is the most likely privacy concern of the app?
(A) Two people using the app at the same location could cause the
signal to be sent and recognized by both vehicles.
(B) Location data would be available and potentially used by the
company to identify future needed updates to the app.
(C) Unauthorized individuals could use the app to summon someone
else’s vehicle.
(D) People could enter the waiting vehicle before the driver gets to it.
49. Which of the following is the most likely potential harm of the app?
(A) Traffic congestion for drivers and pedestrians at restaurant and
shopping entrances that were not designed for multiple waiting
vehicles
(B) Increased air pollution if people leave their self-driving cars idling
until they get to the vehicle
(C) Car accidents when people driving vehicles are maneuvering
around the self-driving waiting vehicles
(D) Illegal parking as people leave their cars running to run into a
store for a “quick” errand
50. What data is most likely to be needed for the app to work?
(A) Fingerprint reader for valid entry to the vehicle
(B) Accurate longitude and latitude coordinates
(C) Cameras for the vehicle to safely navigate to the signaled location
(D) Sensor to recognize the signal summoning the vehicle
51. Tracing what your code is doing is an example of which of the
following terms?
(A) Discovery
(B) Debugging
(C) Traversing
(D) Scaffolding
52. What is an example of “metadata”?
(A) A line of code
(B) A header in a document
(C) Author of the document
(D) Test data
53. Why should we use an iterative development approach?
(A) Because each iteration improves or adds code to build a
successful program
(B) To meet the legal requirements for code to handle sensitive data
(C) To be able to begin coding while remaining requirements are
being defined
(D) To minimize the amount of time needed for testing
54. You need to write a program named calculate to compute the average
temperatures for an area. What would be the best variable name for this
and why?
(A) t—Variable names should be short so there is less opportunity for
a typo.
(B) avgTemperature—Variable names should be descriptive to help
others understand their purpose.
(C) calculateAvgTemp—Variable names should start with program
name and then the variable name for ease of tracking.
(D) 1Temp—Variable names should begin with a number starting with
1, followed by 2, and so on to know how many there are.
55. How can you defend a phishing attack?
(A) Block incoming web traffic until the attack is over.
(B) Open the website in question directly rather than clicking on the
link provided.
(C) Install antivirus software and keep it updated.
(D) Never open unexpected e-mail attachments.
56. On the AP exam, compound expressions can be created using which of
the following operators?
(A) IS / IS NOT
(B) NOT / NOR
(C) IF / ONLY IF
(D) AND / OR
57. What does it mean when we say the Internet is redundant?
(A) Parts of it are unnecessary.
(B) If a path is down, packets can be routed a different way.
(C) It has a delay between the request and the response to the request.
(D) If there is an error, a backup system is brought online to be used.
58. What are packets in reference to the Internet?
(A) The delay in time from when a request is sent and received
(B) The individual sections of the IP address
(C) Information to be sent over the Internet broken into same-size
groupings
(D) The intermediate locations that send information to their
destination
59. What is the best use of spreadsheets and databases?
(A) Scale up to process more data
(B) Organize and filter data
(C) Create metadata
(D) Compress data
60. Which type of problem attempts to find the best solution from several
possibilities?
(A) Algorithmic problem
(B) Decision problem
(C) Efficiency problem
(D) Optimization problem
61. What describes the process of keeping common or similar features and
functionality while removing details that are different?
(A) Algorithm
(B) Decomposition
(C) Simulation
(D) Abstraction
62. A half-time program wants to randomly select a seat number for an
attendee to come shoot baskets for the chance to win prize money.
What code could randomly select a number from a list of seats checked
in? Assume all variables are initialized correctly.
(A) selected ← (RANDOM(start, stop))

(B)
(C) REPEAT UNTIL (RANDOM(start, stop) = 0)

(D)
63. What is a method to confirm a person’s credentials before providing
access? Select two answers.
(A) Biometric identification
(B) Public key encryption
(C) A symmetric password
(D) A security token sent to a device such as a cell phone
64. Which of the following selection statements correctly tests if a number
is less than 914? Select two answers.

(A) Selection 1 is correct.


(B) Selection 2 is correct.
(C) Selection 1 is incorrect.
(D) Selection 2 is incorrect.
65. How can you legally use an image on your website that you found on
the Internet? Select two answers.
(A) You can use it copyright-free from the Internet.
(B) You can use it after paying a fee for use or obtaining written
permission from the owner.
(C) You can use it if you provide attribution to the owner.
(D) You can use it if the author provided a Creative Commons license
allowing such use.
66. What are key steps of any development process to ensure user
requirements are met? Select two answers.
(A) Planning
(B) Feedback
(C) Creating
(D) Reflection
67. Which of the following are events that could trigger event-driven
programming? Select two answers.
(A) Using a remote control for your TV
(B) A sensor sending data to a robot
(C) A program to calculate paycheck amounts
(D) A voice command
68. You have two procedures to select from to continuously loop through a
series of digital billboard ads. Will both procedures successfully work?
Assume the list of advertisements is correctly initialized and the
programs will be restarted each time the ads change, usually weekly.
There are 604,800 seconds in a week. Select two answers.

(A) Block 1 runs correctly.


(B) Block 1 does not run correctly.
(C) Block 2 runs correctly.
(D) Block 2 does not run correctly.
69. Your organization has determined that data used for assigning managers
to high-volume sales stores is unintentionally biased. How can the bias
in the data samples be corrected? Select two answers.
(A) Collect more data for a wider sample of data.
(B) Include a different type of data to add to the collection.
(C) Analyze the source of the data to identify existing bias to remove
it.
(D) Review the attributes to include or ignore in your data collection
and analysis.
70. You have the following procedure that is not working as expected to
add numbers that are divisible by 2 or divisible by 3 to the end of a list.
You collaborate with a classmate to help identify the problem. Assume
the list of numbers passed as an argument holds valid numbers. What
are the errors? Select two answers.

(A) Line 5 should use MOD in both places.


(B) Line 5 should use division “/” in both places.
(C) Line 7 should use APPEND rather than INSERT.
(D) Line 10 has an extra closing brace.

STOP. End of Exam.

You might also like