4 ms·
As a somewhat frequent job interviewer I keep seeing the opposite side. me: "Let's write some code, what's your favorite language?" them: "My favorite? I gues
by lacker 17y ago
As a somewhat frequent job interviewer I keep seeing the opposite side.
me: "Let's write some code, what's your favorite language?"
them: "My favorite? I guess C++"
me: "So how about, write a function to find the most common string in a vector of strings."
They write something like
int MostCommonString(vector v) {
for (int s = v[0]; s < n; s++) {
int count = s
count++
}
return count
}
me: "I see. Well for one, in C++ you need to end each line with a semicolon."
them: "Jeez! Interviewers always expect you to have all this trivia memorized!!!"
- jpeterson 17y agoNot sure what point you're making here. It doesn't really say anything about a programmer if he/she forgets the semicolons when writing out a C++ function by hand. Especially if this person is constantly juggling many different language syntaxes, some of which have line terminators and some not. The function logic is wrong; yes, that's a problem. But forgetting the semicolons has no significance whatsoever.
- lacker 17y agoTake another look at that code. If someone makes that many mistakes in a short space, then even if any one of those mistakes is forgivable, it reveals that they are not a good programmer.
- jacquesm 17y agoI don't think C++ allows you to return variables outside of the scope in which their declarations are active...