APCSP CodeHS Practice Exam

Unethical Use of Computer Resources

  • Question 1: 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 (Correct Answer)   - Using and citing open source code in a personal program
      - Searching the Internet for an online stream of a copyrighted movie (Incorrect Answer)     - Online searches are ethical, even if you are searching for copyrighted materials.

Image Quality in Emails

  • Question 2: A researcher is emailing images of soil samples back to her lab. She notices a quality difference. What could explain this?   - Before being sent, the image was compressed using a lossless compression technique (Incorrect)   - Before being sent, the image was compressed using a lossy compression technique (Correct Answer)   - Some information was lost due to network packets not reaching their final destination (Incorrect)   - Before being sent, the image was encrypted using asymmetric encryption (Incorrect)

Internet Routing Characteristics

  • Question 3: 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 (Incorrect)   - The ability to transmit data between two devices even when some connections in the network are broken (Incorrect)   - The ability to reroute data when one connection is overloaded (Incorrect)   - The ability to use a hierarchical naming system to avoid naming conflicts (Correct Answer)

Overflow Error in Data Storage

  • Question 4: A video viewing website had to deal with an issue involving 32-bit integers. What is it called when the maximum value is exceeded?   - An overflow error (Correct Answer)   - A maximum error (Incorrect)   - A kilobyte error (Incorrect)   - A viewing error (Incorrect)

Task Time Scaling

  • Question 5: Based on a table showing time taken for various tasks, which task is likely to take the longest for a very large company with 100,000 customers?   - Task A (Correct Answer)   - Task B (Incorrect)   - Task C (Incorrect)   - Task D (Incorrect)

Code Analysis

  • Question 6: Analyze the code segment provided. What can be said about the contents of resultList?   - resultList contains all items from inputList that did not meet the Mystery condition (Incorrect)   - resultList is always an empty list (Incorrect)   - resultList contains all items from inputList that met the Mystery condition (Correct Answer)   - resultList always contains all items from inputList (Incorrect)

GPA Average Computation

  • Question 7: A university is calculating average GPAs but contains erroneous data above 4. What is the intended fix?   - IF (studentGPAs[i] ≥ 4) { gradePointAverageSum ← gradePointAverageSum + studentGPAs[i] } ELSE { numGPAs ← numGPAs - 1 } (Incorrect)   - IF (studentGPAs[i] ≤ 4) { gradePointAverageSum ← gradePointAverageSum + studentGPAs[i] } ELSE { numGPAs ← numGPAs - 1 } (Correct Answer)

Importance of Programming Style

  • Question 8: 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 (Correct)   - II) Programming style only applies to certain programming languages (Incorrect)   - III) Programming style increases the reusability of your code (Correct)

ASCII Character Representation

  • Question 9: What ASCII character is represented by binary 1010001?   - S (Incorrect)   - P (Incorrect)   - Q (Correct Answer)   - R (Incorrect)

Program Bug in Finding Maximum

  • Question 10: What change is needed to ensure correct max value in the list?   - No change. This code works (Incorrect)   - Change line 6 to num ← max (Incorrect)   - Change line 1 to max ← list[1] (Incorrect)   - Change line 4 to IF (num ≥ max) (Correct Answer)

Robot Movement in Grid

  • Question 11: Given a robot's starting position and movement restrictions, which code will always reach a gray square in the top row?   - MOVE_FORWARD () MOVE_FORWARD () MOVE_FORWARD () MOVE_FORWARD () ROTATE_LEFT () MOVE_FORWARD () (Incorrect)   - REPEAT UNTIL (CAN_MOVE (left)) { MOVE_FORWARD () } ROTATE_LEFT () MOVE_FORWARD () (Correct Answer)

Purpose of Digital Millennium Copyright Act

  • Question 12: What is the purpose of the Digital Millennium Copyright Act?   - To make all content on the Internet free for everyone to use (Incorrect)   - To allow for open source software on the Internet (Incorrect)   - To criminalize plagiarism on the Internet (Incorrect)   - To criminalize the act of circumventing access controls that block copyrighted works (Correct Answer)

Data and Metadata Use in Blog Platforms

  • Question 13: Which question cannot be answered using collected data and metadata?   - Which users post messages most frequently? (Incorrect)   - What time of day is the site most active? (Incorrect)   - Which posts from a particular user have received the greatest number of comments? (Incorrect)   - In what country is the site most active? (Correct Answer)

Code Functionality in Procedures

  • Question 14: Analyze the provided code segment for the Mystery procedure. What does it do?   - Returns the remainder of number divided by 2 (Incorrect)   - Returns whether or not number is even (Correct Answer)   - Returns number divided by 2 (Incorrect)   - Returns whether or not number is equal to 0 (Incorrect)

Cybersecurity Risks

  • Question 15: Which activity poses the LEAST potential cybersecurity risk?   - Clicking on a link in an email from an unknown sender (Incorrect)   - Sharing your device’s private key used for encryption (Incorrect)   - Sharing your device’s public key used for encryption (Correct Answer)   - Using a credit card to make an online purchase on a website that does not use encryption (Incorrect)

Code Segment and List Operation Analysis

  • Question 16: Based on the code segment provided, how would you best describe the value of resultList?   - resultList is always an empty list (Incorrect)   - resultList always contains all items from inputList (Incorrect)   - resultList contains all items from inputList that met the Mystery condition (Incorrect)   - resultList contains the result of calling the Mystery procedure on every item in inputList (Correct Answer)

Personal Cybersecurity Risks

  • Question 17: Which activity poses the greatest personal cybersecurity risk?   - Entering your password to login to a website encrypted over HTTPS (Incorrect)   - Emailing your bank account number to an online vendor to purchase a product (Correct Answer)   - Providing your email address when taking an online survey (Incorrect)   - Downloading a free text editor program on the Internet (Incorrect)

Coin Flip Simulation Algorithm

  • Question 18: Explain the algorithm to determine even or odd number of tails.   - Algorithm A correctly calculates tails by using MOD 2 (Correct Answer)   - Algorithm B incorrectly uses counters to determine tails (Incorrect)

Limitation of Heuristic Approaches

  • Question 19: What describes a limitation of heuristic approaches?   - A heuristic approach can only provide an approximate solution, rather than an exact solution (Correct Answer)   - Heuristic approaches cannot be run in a reasonable amount of time (Incorrect)   - Heuristic approaches only run on powerful computers (Incorrect)   - Using heuristics generally increases the time for an algorithm to run (Incorrect)

Swap Values Algorithm

  • Question 20: Identify the correct algorithm to swap two variable values.   - y ← x (Incorrect)   - temp ← x; x ← y; y ← temp (Correct Answer)

Network Communication Characteristics

  • Question 21: What statements are true about a network of linked computers?   - I - The network is fault tolerant (Correct)   - II - Computers B and F need to communicate through other devices (Correct)

Searching for Patterns in Data

  • Question 22: Provide an example where searching for patterns produces useful information.   - A high school searching GPAs to identify top students (Incorrect)   - A grocery store checking inventory levels (Incorrect)   - An online retail store analyzing viewing habits (Correct Answer) - *This requires pattern searching.

Bank Alarm System Logic

  • Question 23: Identify the correct boolean expression for the alarm system.   - NOT vaultClosed OR (heardNoise AND sawMovement) (Correct Answer)

Implementing Mystery Procedure Functionality

  • Question 24: What does the Mystery procedure do?   - Returns whether or not the word is in list (Correct Answer)

Bird Migration Research Limitations

  • Question 25: Which question can be answered from tracking bird data?   - How many birds were born in July? (Incorrect)   - In what month do birds travel farthest? (Correct Answer)

Program Representation in Code

  • Question 26: What is true of a program in a programming language?   - The program can also be expressed as binary code, increasing the likelihood of errors (Incorrect)   - The program can also be expressed in binary for execution (Correct Answer)

Analyzing College Student Data

  • Question 27: What can be determined by analyzing college student data?   - Which college has the highest female computer science majors? (Incorrect)   - How many states have CS as a common major for females? (Correct Answer)

Network Communication Analysis

  • Question 28: What is the minimum number of connections that must be broken before computer E can no longer communicate with computer F?   - 1 (Incorrect)   - 2 (Correct Answer)

Reducing Digital Divide Actions

  • Question 29: Which action is most effective in reducing digital divide?   - Providing free wireless Internet in low-income neighborhoods (Correct Answer)

Flowchart Understanding

  • Question 30: What does the displayed flowchart represent?   - Displays algorithm process (Correct Answer)

Analyzing Code Execution Limitations

  • Question 31: What will NOT affect the results when executed?   - Switching lines will change execution (Incorrect)   - Change line 3 to x ← y (Correct)

Benefit from Heuristic Use

  • Question 32: Which program benefits from heuristic use?   - Program that computes the best move in a board game (Correct Answer)

Data Location affected by Geolocation Updates

  • Question 33: What is least likely to occur from geolocation updates?   - Users in certain locations may be blocked (Correct Answer)

Program Display Outcome from Code Execution

  • Question 34: What is displayed after code execution?   - Display value based on conditions (Correct Answer)

Understanding the Mystery Procedure Output

  • Question 35: What does the Mystery procedure return?   - Returns list without instances of given target (Correct Answer)

Selection in Algorithm Usage

  • Question 36: Which uses selection?   - Given two numbers display the larger of the two (Correct Answer)

Minimum Bits for Number Representation

  • Question 37: What is the minimum number of bits needed to represent a 0 to 10 scale?   - 4 (Correct Answer)

Infinite Loop Condition in Program

  • Question 38: What conditions will cause an infinite loop?   - i ← i MOD 3 (Correct Answer)

Metadata Analysis Goals

  • Question 39: When is metadata more useful to analyze?   - Estimating text messages sent next month (Correct Answer)

Limitations of Computer Simulation

  • Question 40: What is true about computer simulations?   - Storing data on the cloud can weaken security (Correct Answer)

Equivalent Expressions of Code Segment

  • Question 41: What is equivalent to return statement?   - y * x (Correct Answer)

Program Behavioral Analysis

  • Question 42: Describe program behavior with RANDOM function.   - Could display either true or false (Correct Answer)

Algorithm Behavior Functionality

  • Question 43: What does this procedure return from a sequence?   - y * x (Correct Answer)

Code Segment Behavior Description

  • Question 44: What describes the behavior of the sum calculation?   - Displays sum of even numbers in list (Correct Answer)

File Transmission in Web Browsers

  • Question 45: True statements about file transmission?   - I and II (Correct Answer)

Get Minimum Value from Lists

  • Question 46: Which procedures get the minimum value correctly?   - Procedure A returns correctly; Procedure B does not (Correct Answer)

Phishing Attacks Understanding

  • Question 47: What is true about phishing attack characteristics?   - I only (Correct Answer)

Lossy Transformations Description

  • Question 48: Which describes a lossy transformation?   - Creating gray scale by averaging RGB values (Correct Answer)

Search Algorithm Efficiency Comparison

  • Question 49: Which search algorithm is generally more efficient?   - Algorithm 2 will be more efficient as list size grows (Correct Answer)

Robot Grid Movement Functions

  • Question 50: Which code moves the robot to gray square?   - REPEAT 4 TIMES: { ROTATE_LEFT () MOVE_FORWARD () ROTATE_RIGHT () MOVE_FORWARD ()} (Correct Answer)

Touching All Gray Squares Logic

  • Question 51: Which code allows the robot to touch all gray squares?   - REPEAT 3 TIMES: { MOVE_FORWARD () MOVE_FORWARD () ROTATE_LEFT () MOVE_FORWARD () } (Correct Answer)

Clear Function Names Importance

  • Question 52: Why are clear function names important?   - It clarifies the function's purpose (Correct Answer)

True Statements on Limitations

  • Question 53: Which statements about algorithm limitations are true?   - III only (Correct Answer)

Robot Hurdle Jump implementation

  • Question 54: What is the implementation of JUMP_HURDLE?   - PROCEDURE JumpHurdle () { MOVE_FORWARD () ROTATE_LEFT () MOVE_FORWARD () MOVE_FORWARD () ROTATE_LEFT () MOVE_FORWARD() } (Correct Answer)

Advantages of Computer Simulations

  • Question 55: What is an advantage of using computer simulations?   - They allow testing without real-world costs or danger (Correct Answer)

Average Calculation in Programs

  • Question 56: Which program correctly calculates average?   - Program 1 displays the correct average; Program 2 does not (Correct Answer)

Mystery Procedure Return from Number Calculation

  • Question 57: What describes the return of the Mystery procedure?   - The return value will be a positive integer greater than or equal to the initial value of number (Correct Answer)

Equivalent Return of Mystery Procedure

  • Question 58: Which expressions are equivalent to value from Mystery(x)?   - x * 5 (Correct Answer)

Boolean Expression Equivalence Evaluation

  • Question 59: Which Boolean expression is NOT equivalent to the original?   - (num < 0) AND (num * -1 = 10) (Correct Answer)

Counting with the Mystery Procedure

  • Question 60: What is the value returned by the Mystery procedure with the given input?   - 3 (Correct Answer)

Program Behavior Description

  • Question 61: What is correctly described about the number-counting program?   - The program correctly displays the count of even numbers between 1 and number (Correct Answer)

Byte Representation of Characters

  • Question 62: How many characters can be represented using 2 bytes?   - 28 times as many characters (Correct Answer)

Infinite Loop Condition Replacement

  • Question 63: What condition could lead to an infinite loop?   - i ← i MOD 3 (Correct Answer)

Text Message Metadata Impactful Analysis

  • Question 64: What goals would metadata analysis be useful for?   - I and III (Correct Answer)

Limitations of Simulation Results

  • Question 65: Which statement is NOT true regarding the company's simulation plan?   - The simulation will not produce usable results (Correct Answer)

Data Compression Algorithm Impact Evaluation

  • Question 66: What year did the data compression algorithm likely start affecting growth?   - 2017 because the data did not grow as fast as before (Correct Answer)

Data Growth Rate Explanation

  • Question 67: What explains slower growth rate after data compression?   - Users started using other services due to quality impact (Correct Answer)

Comparing 4G and 5G Data Usage

  • Question 68: What period had the highest growth percentage in 4G usage?   - Months 12 to 18 (Correct Answer)

Projected 5G Customer Data Usage

  • Question 69: What is the expected data usage in month 36 for 5G customers?   - 7500 (Correct Answer)

Explanation for Higher 5G Usage Rates

  • Question 70: What is the LEAST likely reason for higher 5G data usage?   - Average file size has grown over time *(Correct Answer)