q14

Consider the two programs below.

I chose D for this problem but the correct answer is C because. The programs each display ten values, but each value displayed by program B is one greater than the corresponding value from program A. Program A displays 1 2 3 4 5 6 7 8 9 10 and program B displays 2 3 4 5 6 7 8 9 10 11.

q23

The following figures represent different ways of configuring a network of physically linked computers labeled P, Q, R, and S. A line between two computers indicates that the computers can communicate directly with each other. In which configuration is it NOT possible to have redundant routing between computers P and S?

I chose C but B is the right answer because redundant routing is impossible if there is only one possible path from one device to another. There is only one possible path from P to S (P to R to Q to S).

q28

A text-editing application uses binary sequences to represent each of 200 different characters. What is the minimum number of bits needed to assign a unique bit sequence to each of the possible characters?

I chose A but the correct answer is D because Using 8 bits will allow for up to 256 characters open parenthesis, 2 raised to the eighth power equals 256, close parenthesis.

q30

A video-streaming service maintains a database of information about its customers and the videos they have watched. The program below analyzes the data in the database and compares the number of viewers of science fiction videos to the number of viewers of videos of other genres. It uses the procedure Analysis, open parenthesis, category, close parenthesis, which returns the number of unique users who viewed videos of a given category in the past year. The Analysis procedure takes approximately 1 hour to return a result, regardless of the number of videos of the given genre. All other operations happen nearly instantaneously.

I chose A for this question but D was the correct answer for it because Each call to the Analysis procedure requires one hour of program execution time. The procedure is called once before the loop, and then four times inside the loop (once for each of the four entries in One word, genre List). Therefore, the program will take approximately 5 hours to execute.

q43

Grades in a computer science course are based on total points earned on a midterm exam and a final exam. The teacher provides a way for students to improve their course grades if they receive high scores on the final exam: if a student’s final exam score is greater than the student’s midterm exam score, the final exam score replaces the midterm exam score in the calculation of total points.

The table below shows two students’ scores on the midterm and final exams and the calculated total points each student earns.

Student Name Midterm Exam Score Final Exam Score Total Points Calculation
Khalil 90 80 90 plus 80 equals 170
Josefina 70 90 70 plus 90 equals 160

Khalil does better on the midterm exam than on the final exam, so his original midterm and final exam scores are added to compute his total points. Josefina does better on the final exam than on the midterm exam, so her final exam score replaces her midterm exam score in the total points calculation. The teacher has data representing the scores of thousands of students. For each student, the data contain the student name, the midterm exam score, the final exam score, and the result of the total points calculation. Which of the following could be determined from the data?

I. The average total points earned per student
II. The average increase in total points per student as a result of the score replacement policy
III. The proportion of students who improved their total points as a result of the score replacement policy

I chose B for this question but D is the right answer because The average total points earned per student can be determined using the result of the total points calculation for each student. The average increase in total points per student as a result of the score replacement policy can be determined by calculating the differences between each student score before and after the replacement policy was applied. The proportion of students who improved their total points as a result of the score replacement policy can be determined by comparing the midterm and final scores for each student with the result of the total points calculation.

q47

In public key cryptography, the sender uses the recipient’s public key to encrypt a message. Which of the following is needed to decrypt the message?

I chose C but the correct answer is D because In public cryptography, a message is encrypted with a recipient’s public key and decrypted with the recipient’s private key.

q50

The procedure below searches for the value target in list. It returns true if target is found and returns false otherwise. Which of the following are true statements about the procedure?
I. It implements a binary search.
II. It implements a linear search.
III. It only works as intended when list is sorted.

I chose A but the correct answer was B because The procedure implements a linear search, which sequentially compares each element of the list with the target value. The list does not need to be sorted because the procedure checks list elements until either the target is found or it reaches the end of the list.

q52

A programmer is developing a word game. The programmer wants to create an algorithm that will take a list of words and return a list containing the first letter of all words that are palindromes (words that read the same backward or forward). The returned list should be in alphabetical order. For example, if the list contains the words Open bracket, open quotation, banana, close quotation, open quotation, kayak, close quotation, open quotation, mom, close quotation, open quotation, apple, close quotation, open quotation, level, close quotation, close bracket, the returned list would contain Open bracket, open quotation, k, close quotation, open quotation, l, close quotation, open quotation, m, close quotation, close bracket (because Open quotation, kayak, close quotation, Open quotation, level, close quotation, and Open quotation, mom, close quotation are palindromes). The programmer knows that the following steps are necessary for the algorithm but is not sure in which order they should be executed.
Executing which of the following sequences of steps will enable the algorithm to work as intended?
I. First shorten, then keep palindromes, then sort
II. First keep palindromes, then shorten, then sort
III. First sort, then keep palindromes, then shorten

I chose B but the correct answer is D because Options II and III perform the steps in a correct order. In order to generate the desired list, the algorithm must perform the “shorten” step after the “keep palindromes” step, otherwise the “keep palindromes” step would not be able to determine whether the original word was a palindrome.

q54

A programmer notices the following two procedures in a library. The procedures do similar, but not identical, things.
Procedure Square, open parenthesis, n, close parenthesis returns the value N squared.
Procedure Cube, open parenthesis, n, close parenthesis returns the value N raised to the third power.

Which of the following procedures is a generalization of the procedures described above?

I chose C but the correct answer is D because The procedures square and cube are each used to determine a power of n. A generalization of this procedure is Power, open parenthesis, n comma m, close parenthesis, which calculates n raised to the m power.

q55

A student wrote the procedure below, which is intended to ask whether a user wants to keep playing a game. The procedure does not work as intended. Which of the following best describes the result of running the procedure?

I chose A but the correct answer is D because The expression open parenthesis, open parenthesis, response equals, open quotation, y, close quotation, close parenthesis, AND, open parenthesis, response equals, open quotation, yes, close quotation, close parenthesis, close parenthesis always evaluates to false because it is not possible for the variable response to be equal to both Open quotation, y, close quotation and Open quotation, yes, close quotation. Therefore, the procedure will always return false.

q58

Which of the following are true statements about how the Internet enables crowdsourcing?
I. The Internet can provide crowdsourcing participants access to useful tools, information, and professional knowledge.
II. The speed and reach of the Internet can lower geographic barriers, allowing individuals from different locations to contribute to projects.
III. Using the Internet to distribute solutions across many users allows all computational problems to be solved in reasonable time, even for very large input sizes.

I chose C but the correct answer is A because the Internet can provide tools, information, and knowledge to crowdsourcing participants and can lower geographic barriers to potential participants. However, there exist problems that cannot be solved in reasonable time, even with a distributed approach.

q60

Which of the following are ways in which a programmer can use abstraction to manage the complexity of a program?

I chose A and B but the correct answer is A and D because placing repeated code with procedure calls is an example of a procedural abstraction that may make it easier for a programmer to manage the complexity of a program.

Things to fix

Skill 3C - Develop programs that include abstractions. And explain how abstraction manages complexity. Skill 2B - Develop and implement algorithms. Skill 4B - Evaluate and test algorithms and programs

Key Concepts to Work On

  1. Networks & Redundancy:
    • Understand how to identify redundant paths in network diagrams.
  2. Binary Representation:
    • Learn how ( 2^n ) represents unique values.
    • Solve problems involving encoding schemes.
  3. Algorithm Efficiency:
    • Break down algorithms step-by-step.
    • Calculate execution times and understand complexity.
  4. Search Algorithms:
    • Differentiate between linear (unsorted) and binary (sorted) search.
  5. Public Key Cryptography:
    • Understand how public and private keys work for encryption and decryption.
  6. Abstraction in Programming:
    • Practice creating procedural abstractions to simplify complex code.
  7. Crowdsourcing Limits:
    • Recognize the strengths and limitations of distributed computing.

How to Improve

  1. Practice:
    • Solve problems on networks, algorithms, binary representations, and encryption.
  2. Review:
    • Study encryption, algorithm complexity, and abstraction examples.
  3. Code:
    • Write small programs for search algorithms and abstraction use.
  4. Test Strategies:
    • Focus on careful question analysis and eliminating wrong answers.

Follow these steps to strengthen weak areas and improve accuracy. Let me know if you need specific examples or resources!