66 MC questions blog
This is my score:
I spent about 3 hours on the MC (lost track of time because I took breaks in between)
I got #1 wrong because I thought that num
in the for each loop would change the value of the element in the array. However, num
is actually assigned a copy of the element, so althought the values of num
are changed, the actual elements inside the array do not change.
I got #32 wrong because it made sense to me that lenCount
had to reset if the elements were not consecutive anymore. However, I failed to realize that if lenCount was not larger than maxLen, lenCount
still needed to be reset, which would not have been the case by selecting D.
No context for #36.
I answered wrong on #50 because I did not realize that i < num1
would mean that 10 is excluded. Therefore, to print 10, the correct answer would be D, which used 20
as the bound.
I gto #52 wrong because the answer of adding a return type to the method looked very appealing. However, this does not fulfill the requirements of the method, which is to update the value of price. Therefore, price += surcharge
would be the correct answer.