What to do with a lack of C ++ skill test

In the next gcc.gnu.org article, Nathan Myers says that the C ++ skills test at SANS Consulting Services contained three errors in nine questions:

Looking back, one of the first online C ++ tests I came across was: http://www.geekinterview.com/question_details/13090

I looked at question 1 ...

find(int x,int y) { return ((x<y)?0:(xy)):} 

call find (a, find (a, b)) to use for searching (a) maximum a, b (b) minimum a, b (c) positive difference a, b (d) sum a, b

... immediately wondered why anyone would write something so dumb. Passing by the absurd, I did not like any of the answers, immediately eliminating (a) and (b), because you can return to zero (which is neither a nor b) in a variety of circumstances. The sum or difference seemed more likely, except that you could also get zero regardless of a and b. So ... I ran Matlab (code below) and found: when either a or b is negative, you get zero; when b> a you get; otherwise you will get b, so the answer will be (b) min (a, b) if a and b are positive, although, strictly speaking, the answer should not be any of the above, since there are no range restrictions for any variable. This forces the subjects to solve the dilemma - choose the best available answer and make a mistake in 3 of 4 quadrants, or do not answer, leaving the door open to conclude that the grader believes that you cannot understand this.

The solution for testers is to fix the test, but in the meantime, what is the right course of action for testers? Complain about questions?

 function z = findfunc(x,y) for i=1:length(x) if x(i) < y(i) z(i) = 0; else z(i) = x(i) - y(i); end end end function [b,d1,z] = plotstuff() k = 50; a = [-k:1:k]; b = (2*k+1) * rand(length(a),1) - k; d1 = findfunc(a,b); z = findfunc(a,d1); plot( a, b, 'r.', a, d1, 'g-', a, z, 'b-'); end 
+4
source share
3 answers

Why are you wasting time doing tests like the online connection you contacted? It is so bad that words are not enough to describe the horror.

What you should do in this case is to wash your eyes with soap, get drunk and hope that you will not remember anything in the morning ...

+3
source

I had the same problem on a test a few years ago.

Options A, B, C or D are possible.

I wrote in option E with my answer, and then clearly explained why the other four were wrong.

The test was conducted remotely and received an interview call on the same day.

... you can take it for what it costs.

+2
source

I prefer to write notes in the test, explaining where the test is invalid. I also want to discuss these issues with interviewers.

I like to support my beliefs against horrible code, and especially pieces of code on tests that are never used or very rarely used in the real world.

0
source

Source: https://habr.com/ru/post/1307078/


All Articles