Score: 51/66 (77%)

image

The test took me around an hour and 15 minutes to complete in multiple sessions and there were definitely concepts that I completely forgot how to do. I tried to take the test all on my own but had to reference google for a few of them. Some of these weaknesses I believe I can iron out and become better at once I get the concept down with more practice.

Some of the weak areas include:

  • Demorgan's Law
  • Compile Errors
  • Enhanced For Loop

Q4

image The correct answer should have been e because based on DeMorgan's law, the not should be distributed as well as change the && to ||.

Q7

image The correct answer should have been d, I and III because al is initialized in a completely different class so does not exist in class B. Therefore, III would also cause a compile time error.

Q12

image The correct answer should have been a, because the || (or sign) will have been distributed but the && will go in between the two statements. Therefore it would be a, not b.

Q14

image This is another demorgan's law question that I got wrong. The answer should have been b, not a because the opposite of b>7 would be b<=7 and not just <.

Q16

image The problem I had with this question was that I was confused on how the enhanced for loop works (for each loop). After looking back on it and seeing how it iterates, I now see how it should assign a one-dimensional array of int values, single row of two-dimensional array and not a row of col since col is not a two-dimensional array.

Q19

image This is another demorgan's law question that I got wrong and after seeing it, I now know that the answer should have been a since the not distributes inside of the parenthesis first and then the outside ! distributes into all of the terms inside the parenthesis making it an || and not an &&.

Q21

image This is a compile error question that I got wrong and the anwer should have been e, not b since the reset method returns void which means that it can't return any value. The new password can be the same as the old password and it won't throw a compile error.

Q25

image The answer should have been b, not c because in this compile error question the method updateItems must have a return type and there is nothing there. It should be void if it isn't returning anything so the answer should be b. I believe I completely overlooked the method creation so I got this wrong.

Q32

image The answer should have been e, not d. This is because we want lenCount=0 to be put inside of the else statement and not inside of the if statement inside of the else statement.

Q33

image The answer should be c, not e since maxVal is the largest value in arr so it will never be updated and will always be 0. Therefore it could be initialized to the first element in arr to fix this problem.

Q34

image This is an equivolence question and the answer should have been d, instead of a because we want sum to equal sum+2*(element of arr at k) and not just k. This will yield an equivalent result and I think that I simply overlooked the big difference that k and arr at index k can have.

Q36

image This is another compile time error question that I got wrong and the answer should be Line 4 only and not Line 1. I'm not sure what the GridWorld case study is referring to so I wasn't really sure how I would do this question. As a result I guessed and I'm still not sure what this GridWorld case study is.

Q39

image The answer should have been a, not d since 1900 is not a leap year but it is divisible by 4. However, it is divisible by 100 but not 400 so therefore it is not a leapyear and will return incorrectly.

Q41

image The answer should be b, not d since the method call returns 12 and since c is true, the body of the third if statement runs and the value of 7+4=11 is returned.

Q56

image The answer should be e, not b since we don't want k to add one each time the while loop executes. We only want k++ to occure if the if statement is not satisfied. Therefore, we need an else statement before the k++.