Review of Test

I think overall I did pretty well on the test. There were a few questions I didn’t really understand, but I was able to get the basics of all the concepts.

Missing Questions

1. Which of the following has the greatest potential for compromising a user’s personal privacy?

A A group of cookies stored by the user’s Web browser

B The Internet Protocol (IP) address of the user’s computer

C The user’s e-mail address

D The user’s public key used for encryption

Answer A This option is correct. The aggregation of information in browser cookies can be used by websites that the user visits to track the user and collect information about the user.

My Response: I chose B for this question. I wasn’t to sure about security and because of doxxing and IP addresses being linked I just assumed having the IP address was more dangerous. However, since a massive amount of user activity can be stored in cookies it can do far more damagae in terms of tracking a user’s private behavior.

2. For which of the grids does the program correctly move the robot to the gray square?

A Grid I only

B Grid II only

C Both grid I and grid II

D Neither grid I nor grid II

Answer A This option is correct. In Grid I, the robot moves forward to the end of the bottom row, turns right twice, moves forward twice, turns right twice, moves forward until the end of the middle row, turns left twice, moves forward twice, turns left twice, and moves forward until Goal_Reached is true.

My Response I chose option D on accident because for some reason I had confirmed it could go through grid I in my head, but upon calculating the movement for grid II I associated that grid with both for some reason.

3. Select two answers.

A newString ← substring(oldString, 3, len(oldString) - 4)

B newString ← substring(oldString, 3, len(oldString) - 2)

C tempString ← substring(oldString, 3, len(oldString) - 2)

newString ← substring(tempString, 1, len(tempString) - 2)

D tempString1 ← substring(oldString, 1, 2)

tempString2 ← substring(oldString, len(oldString) - 2, 2)

newString ← concat(tempString1, tempString2)

Answer A Correct. To remove the first 2 characters of oldString, this code segment takes a substring starting at position 3. To remove the last 2 characters of oldString, the substring ends at the position that is 4 characters less than the length of oldString (since 4 characters are removed).

My Response: Here I selected D and C, I didn’t exactly understand how newString in A worked and thought it just removed the end 4 characters.

4. What is displayed as a result of executing the code segment?

A true true true

B false false false

C true false true

D false false true

Answer B Correct. The first three statements assign values to the variables. The fourth statement assigns the value of (NOT (a OR b)) AND c to a. Since a OR b is true, NOT (a OR b) is false, so (NOT (a OR b)) AND c is false. The fifth statement assigns the value of c AND a to c. Since a is now false, c AND a is false. The last three statements display the values of the variables.

My Response: I chose C here mostly because I forgot how the order of operations reassigns the values in situations like these.

5. Based on the values in the table, which of the algorithms appear to run in reasonable time?

Select two answers.

A Algorithm A

B Algorithm B

C Algorithm C

D Algorithm D

Answer A Correct. As the size of the list grows, the number of steps needed to sort the list grows at a linear rate, as the number of steps is equal to 10n for a list of size n . This is an example of a polynomial efficiency and indicates that the algorithm runs in a reasonable amount of time.

My Response: I chose B and D here. While D was correct, B was not, I really just wasn’t sure what algorithm A would do and so didn’t choose it.