Let's All Reinvent the Wheel... Again, and More

« Return to Article
  • pitchingchris 2008-05-07 10:08
    this comment was typed wit a minor mistake
  • DarkAngl 2008-05-07 10:11
    wat mistake? i dont do mistakes!
  • veniam 2008-05-07 10:12
    std::cout << "I don't think will work with that crazy \"std::\", but I'll try to post my comments anyway!" << endl;
  • pitchingchris 2008-05-07 10:12
    DarkAngl:
    wat mistake? i dont do mistakes!


    I just start my comments from scratch all over again !
  • FredSaw 2008-05-07 10:18
    Hey, wait, consider me! I am a team player with some independently abilities, too!
  • Lingerance 2008-05-07 10:19
    veniam:
    std::cout << "I don't think will work with that crazy \"std::\", but I'll try to post my comments anyway!" << endl;

    Did you forget endl is in the std namespace?
  • FredSaw 2008-05-07 10:26
    If "Exclusive research skills with details" means she can find stuff nobody else can find, she needs to apply to the CIA or FBI.
  • snoofle 2008-05-07 10:29
    Dear Mr[s]. Employer-Person,

    I am good werkr. I try hard, and sometimes succeed very muchly. If yu gv me a chanc, I will send u teh codez.

    Thank you very much,
    Your soon-to-be humble slave...
  • David Schwartz 2008-05-07 10:33
    Highly-experienced C++ programmers might have little to no familiarity with the standard library functions. This is especially true for people who have been programming C++ for a very long time and maintain codebases that still have to run on machines whose standard library support is somewhat lacking.

    One of the projects I manage has a codebase of about 730,000 lines of C++ code. It does not use the standard library at all. At the time it was initially developed, some of the platforms it had to run on did not have standard libraries that worked properly with threading, so it has its own set of libraries. We have programmers we've hired out of high school who have worked for a decade on only this code.

    Of course, if you use the standard library heavily, you may have some issues with them building familiarity with it. But a good programmer can learn a new library in a few days at most.

    It's a huge mistake to judge programmers based on whether they have skills a good programmer could pick up in a week or less. You want good programmers.
  • gabba 2008-05-07 10:33
    Two excellent examples of WTFs on the part of those conducting the interviews. Asking people to criticize their own work is just stupid. It's your job to find out what's wrong with them; don't ask them to volunteer that information. And asking people to find flaws in some artificial "Where's Waldo" bad code is equally stupid. Give them a realistic problem and ask them to solve it, already.
  • SomeCoder 2008-05-07 10:35
    I'm not saying that the C++ test is a WTF, this is just a comment about it...

    While the candidate that didn't know what "std" means was surely a WTF, I'm not sure I would have automatically circled std::string as an error.

    Truth be told, I always pass strings as const std::string& for efficiency but std::string wouldn't really jump out to me as an "error". I'd probably comment on it though.

    Hopefully your test also looks for people who use ++myVariable vs myVariable++ (where appropriate).
  • Lev 2008-05-07 10:35
    I work [my] wit!
  • Resolute 2008-05-07 10:36
    That resume is one of those "how many errors can you find?" puzzles, right? Using my independently abilities, I exclusively researched at least five errors in that one section.
  • Marvin the Martian 2008-05-07 10:39
    OK, the <wit> typo is clearly a joke (I have the same sense of humour), but how do you explain the <independently abilities>?

    15 typos mysteriously occuring simultaneously after the <independent> part? Insanity? I think we should be told.
  • FredSaw 2008-05-07 10:39
    Resolute:
    Using my independently abilities, I exclusively researched at least five errors in that one section.
    Yeah, but you dint cum up wit no details.
  • Ytram 2008-05-07 10:39
    ...and get the trick questions wrong, as did most people...


    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?
  • WhiskeyJack 2008-05-07 10:41
    So my question for the interviewers is, in situations like these, why do you have to keep stringing along the candidate, say "we'll call you if you get the position", etc., even though in their minds they've already cemented their decision as a 100% no?

    With candidates like these you should be able to just say "Well, um, that's not really what we're looking for, so thank you for your time". Get it over with quickly, let the interview candidate know that he's done here, everyone moves on.
  • FredSaw 2008-05-07 10:41
    Ytram:
    ...and get the trick questions wrong, as did most people...
    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?
    Perhaps, to see if/how they turn a trick?
  • brazzy 2008-05-07 10:46
    David Schwartz:
    Highly-experienced C++ programmers might have little to no familiarity with the standard library functions. This is especially true for people who have been programming C++ for a very long time and maintain codebases that still have to run on machines whose standard library support is somewhat lacking.

    Not being familiar with details of the standard library is excusable, but not even knowing what it is is not.


    But a good programmer can learn a new library in a few days at most.

    It's a huge mistake to judge programmers based on whether they have skills a good programmer could pick up in a week or less. You want good programmers.

    IMO someone who's been working for years in a narrow niche and has made NO effort to keep up to date with important developments in the field (to the point that they don't even know what the standard library is) is very unlikely to be a good programmer.
  • the pope 2008-05-07 10:47
    A clerical position was offered, and I've not been informed? Heresy!
  • Russ 2008-05-07 10:49
    Ytram:
    ...and get the trick questions wrong, as did most people...


    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?


    No so people know how to find bugs in code. For example

    x=3
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?
  • diaphanein 2008-05-07 10:52
    Russ:
    Ytram:
    ...and get the trick questions wrong, as did most people...


    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?


    No so people know how to find bugs in code. For example

    x=3
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?


    5. Next?
  • Some 2008-05-07 10:53
    Trick questions are the most beautiful part of any test. If someone answered it correctly, then that means one of two thinks – he saw this question before (he had many interviews and possibly for good reason – also bad candidate) or he’s a genius – also he’ll never do what he should, instead he’ll search for “very interesting” ways to do the task (no matter how much time it takes)
  • Russ 2008-05-07 10:54
    brazzy:
    David Schwartz:
    Highly-experienced C++ programmers might have little to no familiarity with the standard library functions. This is especially true for people who have been programming C++ for a very long time and maintain codebases that still have to run on machines whose standard library support is somewhat lacking.

    Not being familiar with details of the standard library is excusable, but not even knowing what it is is not.


    But a good programmer can learn a new library in a few days at most.

    It's a huge mistake to judge programmers based on whether they have skills a good programmer could pick up in a week or less. You want good programmers.

    IMO someone who's been working for years in a narrow niche and has made NO effort to keep up to date with important developments in the field (to the point that they don't even know what the standard library is) is very unlikely to be a good programmer.


    What if they did C++ on a *nix platform? Not the whole world is MS centric you know.
  • Crabs 2008-05-07 10:54
    With candidates like these you should be able to just say "Well, um, that's not really what we're looking for, so thank you for your time". Get it over with quickly, let the interview candidate know that he's done here, everyone moves on.


    Because some people don't move on. There is a small percentage of people that, if you take this approach, will completely freak out on you. To try to avoid this situation, you make it more polite. Sure, I guess it's stringing them along, but good candidates understand this answer (and should have more than one interview), and the candidates in question don't have their feelings hurt. It's a win-win.
  • Schnapple 2008-05-07 10:55
    brazzy:
    David Schwartz:
    Highly-experienced C++ programmers might have little to no familiarity with the standard library functions. This is especially true for people who have been programming C++ for a very long time and maintain codebases that still have to run on machines whose standard library support is somewhat lacking.

    Not being familiar with details of the standard library is excusable, but not even knowing what it is is not.


    Especially if the job they're interviewing for uses it extensively and needs someone who is an expert at it. I think that's what the "immensely high standards" build-up was supposed to communicate to us - this person might have been a fine developer, or potentially one, but to not know what the standard library is, or to expose ones unfamiliarity in such a bonehead way, is pretty much doom in an interview like this.

    But yeah if the goal of the story was something like "this is supposed to be a great C# programmer but they don't even know what company makes Windows" then it fell flat as a WTF
  • Russ 2008-05-07 10:56
    diaphanein:
    Russ:
    Ytram:
    ...and get the trick questions wrong, as did most people...


    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?


    No so people know how to find bugs in code. For example

    x=3;
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?


    5. Next?


    I really hope that was sarcasm
  • Chris M. 2008-05-07 10:56
    Russ:
    Ytram:
    ...and get the trick questions wrong, as did most people...


    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?


    No so people know how to find bugs in code. For example

    x=3
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?


    Fails to compile, since there's no ";" after x=3 and the else has no if (the if statement ended on the ";" in 'cout<<"5";'). Watch those semicolons!
  • Vollhorst 2008-05-07 10:56
    [quote user="Russ"][quote user="Ytram"]No so people know how to find bugs in code. For example

    x=3
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?[/quote]

    It is:

    error: expected constructor, destructor, or type conversion before ‘=’ token
    error: expected unqualified-id before ‘else’


    But I expect you would like to hear "5".
  • Some 2008-05-07 10:57
    Russ:
    Ytram:
    ...and get the trick questions wrong, as did most people...


    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?


    No so people know how to find bugs in code. For example

    x=3
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?


    That's not really a trick question....
  • Max 2008-05-07 10:58
    Russ:
    Ytram:
    ...and get the trick questions wrong, as did most people...


    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?


    No so people know how to find bugs in code. For example

    x=3
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?


    A compiler error? No semicolon...
  • Vollhorst 2008-05-07 10:59
    Chris M.:
    the else has no if (the if statement ended on the ";" in 'cout<<"5";'). Watch those semicolons!
    You aren't serious, are you?
  • Erik 2008-05-07 11:02
    Clearly the woman applying for the clerical position is very detail orented.
  • Russ 2008-05-07 11:04
    Russ:
    diaphanein:
    Russ:
    Ytram:
    ...and get the trick questions wrong, as did most people...


    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?


    No so people know how to find bugs in code. For example

    x=3;
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?


    5. Next?


    I really hope that was sarcasm


    Actually my bad.. haven't had my morning coffee yet.

    The answer should be 5. It is a bit of a trick question, as some junior developers might not know the difference between

    if (x==5)

    and

    if (x=5)

  • Carl 2008-05-07 11:04
    Chris M.:
    Russ:
    Ytram:
    ...and get the trick questions wrong, as did most people...


    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?


    No so people know how to find bugs in code. For example

    x=3
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?


    Fails to compile, since there's no ";" after x=3 and the else has no if (the if statement ended on the ";" in 'cout<<"5";'). Watch those semicolons!

    It does fail to compile, but there is nothing wrong with the if/else.
  • matt 2008-05-07 11:05
    Ytram:
    ...and get the trick questions wrong, as did most people...


    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?


    Whist is a complicated game, man.
  • snoofle 2008-05-07 11:05
    Chris M.:
    Russ:
    Ytram:
    ...and get the trick questions wrong, as did most people...


    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?


    No so people know how to find bugs in code. For example

    x=3
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?


    Fails to compile, since there's no ";" after x=3 and the else has no if (the if statement ended on the ";" in 'cout<<"5";'). Watch those semicolons!
    Or perhaps that was the point - subtle bug is single = in if-boolean-test, more subtle bug is the compiler error: x=3<no semi>

    And yeah, I hate those sorts of questions too (I mostly always get them right, then use it as an excuse to terminate the interview, as in: interviewer doesn't know how to interview: FAIL!)
  • SomeCoder 2008-05-07 11:08
    Chris M.:


    ...else has no if (the if statement ended on the ";" in 'cout<<"5";'). Watch those semicolons!



    Umm what?

    Assuming x is defined and adding the semicolon to the end of x=3, the answer is 5 (obviously). It's not really a trick question because anybody who writes C code should be able to find that and if not... well they need to be sent packing.
  • real_aardvark 2008-05-07 11:09
    Russ:
    brazzy:
    David Schwartz:
    Highly-experienced C++ programmers might have little to no familiarity with the standard library functions. This is especially true for people who have been programming C++ for a very long time and maintain codebases that still have to run on machines whose standard library support is somewhat lacking.

    Not being familiar with details of the standard library is excusable, but not even knowing what it is is not.


    But a good programmer can learn a new library in a few days at most.

    It's a huge mistake to judge programmers based on whether they have skills a good programmer could pick up in a week or less. You want good programmers.

    IMO someone who's been working for years in a narrow niche and has made NO effort to keep up to date with important developments in the field (to the point that they don't even know what the standard library is) is very unlikely to be a good programmer.


    What if they did C++ on a *nix platform? Not the whole world is MS centric you know.

    Ho ho, I think we have a major candidate right here...

    To David Schwartz: although you may have a point about most libraries, a week is definitely not long enough to pick up the STL. Even to understand the goddamn error messages would take this long. Plus, as Brazzy says, if you haven't read a single relevanat book on C++ in the last ten years, you are probably toast as a potential employee.
  • Chris 2008-05-07 11:11
    My initial thought would be that if they WERE good programmers they are keeping themselves reasonably up to date. Studying new practices, languages, and additional functionality. If a "good" programmer doesn't know about the std library in C++, then I would say they aren't that "good"
  • ChiefCrazyTalk 2008-05-07 11:11
    WhiskeyJack:
    So my question for the interviewers is, in situations like these, why do you have to keep stringing along the candidate, say "we'll call you if you get the position", etc., even though in their minds they've already cemented their decision as a 100% no?

    With candidates like these you should be able to just say "Well, um, that's not really what we're looking for, so thank you for your time". Get it over with quickly, let the interview candidate know that he's done here, everyone moves on.


    I'll tell you why - I once interviewed a candidate who was simply awful, could not answer a single tech question. He even apologized for doing so poorly at the end of the interview. But, I was not the hiring manager and so could not officially tell him yes or no. The real WTF was that in spite of my feedback they hired him anyway.
  • Chris Becke 2008-05-07 11:16
    I dont buy the std:: thing as a reason to terminate the interview. c++ is an ancient language, and many very very competent developers have been working with it since way before the standard template library - or, during the horrible time when most stl implementations were both notoriously unstable and ... not very standard.
  • shadowman 2008-05-07 11:17
    Russ:
    diaphanein:
    Russ:
    Ytram:
    ...and get the trick questions wrong, as did most people...


    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?


    No so people know how to find bugs in code. For example

    x=3;
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?


    5. Next?


    I really hope that was sarcasm


    Why should it be sarcasm? It's the correct answer. It's your question, right?
  • vt_mruhlin 2008-05-07 11:21
    Lingerance:
    veniam:
    std::cout << "I don't think will work with that crazy \"std::\", but I'll try to post my comments anyway!" << endl;

    Did you forget endl is in the std namespace?


    I bet he was
    using namespace std;
    anyhow, but had a different cout defined in another namespace and had to remove the ambiguity...
  • dpm 2008-05-07 11:21
    As soon as I've finished and installed the application, I delete the code.
    After 20+ years of working in this industry, I am ready to believe any damned thing at all that appears on this board, no matter how much people cry "shenanigans!" . . . but this one has me stumped. What could the interviewee possibly be thinking, what could he have meant? Not even the dumbest moron I've been forced to work against^H^H^H^H^Hwith would have actually deleted the source, but I can't imagine what he might have been referring to.
  • morry 2008-05-07 11:29
    I'd be willing to believe that the "wit" misspelling is just that - wit. A joke.

    I'd like to come up with some trick questions to ask a company in an interview some time.
  • DOA 2008-05-07 11:34
    I'd reply but I don't know what the Add Comment button does. Oh, wait...
  • Alan 2008-05-07 11:35
    Russ:


    The answer should be 5. It is a bit of a trick question, as some junior developers might not know the difference between

    if (x==5)

    and

    if (x=5)



    How junior? Pre-school?
  • J_Random_Hacker 2008-05-07 11:36
    I don't think that passing a std::string as a non-const value parameter is necessarily an error; it is less efficient than passing a const reference if the strings are long (unless string copies are performed lazily, in which case the difference in performance would be negligible in typical scenarios). On the other hand, if the called function needs to modify the value for its own internal purposes (e.g. it wants to produce an uppercased version for searching some table), it is probably more efficient to modify a non-const value argument directly than to copy-construct a new local std::string variable from a const reference argument and then modify that.

    (Just to be clear, a non-const, pass-by-value parameter is a copy of the passed parameter so any modifications will not be seen by the calling function. There are many situations where this might be useful behaviour, such as the conversion to uppercase mentioned above.)

    So if that was "the most obvious error" in the buggy code, I'm concerned.

    JRH
  • dkf 2008-05-07 11:37
    dpm:
    What could the interviewee possibly be thinking
    That's the problem right there. Thinking. Some people simply hate doing it.
  • OedipusPrime 2008-05-07 11:38
    Russ:
    It is a bit of a trick question, as some junior developers might not know the difference between

    if (x==5)

    and

    if (x=5)



    Knowing the difference and being able to quickly spot the error are two different things, but I REALLY hope that even the juniorest guy in the room can tell you the difference between assignment and comparison operators.
  • Anon Fred 2008-05-07 11:43
    real_aardvark:
    Russ:
    IMO someone who's been working for years in a narrow niche and has made NO effort to keep up to date with important developments in the field (to the point that they don't even know what the standard library is) is very unlikely to be a good programmer.
    There's a lot of stuff to learn in the world. Maybe instead of learning the standard library they learned what was new in the latest Common Lisp. Maybe instead of learning prototype.js they learned ASP.

    If I was hiring for a new Ruby on Rails project, I'd rather have a generalist who has at least done some web programming than someone who can pound out 1 or 2 ROR applications.

    a week is definitely not long enough to pick up the STL. Even to understand the goddamn error messages would take this long.
    I've never professionally used the STL, despite 2 major C++ jobs. It was because both had their own very good reasons for using a different library. I played with the STL on my own time, but as I said before I could've easily have spent that time on some other learning project instead.

    If you've used other libraries before, the STL really isn't that difficult. The functional programming component can be difficult to grasp, but I bet lots of people who consider themselves "expert" in the STL have never touched that, or Boost.
  • mauve 2008-05-07 11:44
    The std:: issue is the inevitable fallout of a language which had been in use for 20 years before anyone got around to publishing a standardised specification (and which, when they did, was significantly different to the language people had been programming in).

    Half the printed literature doesn't mention namespaces. Your average librarian doesn't know that any C++ book prior to 1998 is worthless.

    I suspect that there are tons of people who have slipped through the cracks and who would be perfectly competent C++ programmers. Would you, for instance, exclude former C++ programmers who've had a job programming embedded C for the last decade?
  • pitchingchris 2008-05-07 11:45
    This is exactly the reason you should make beginners learn a C type language first, cause if they can learn it (no matter how painful) the rest are a bit easier. Whereas someone who learned other languages such as vb or whatever, they won't pick up on subtle differences in comparison operators as easily
  • Some Interviewer 2008-05-07 11:45
    WhiskeyJack:
    So my question for the interviewers is, in situations like these, why do you have to keep stringing along the candidate, say "we'll call you if you get the position", etc., even though in their minds they've already cemented their decision as a 100% no?

    With candidates like these you should be able to just say "Well, um, that's not really what we're looking for, so thank you for your time". Get it over with quickly, let the interview candidate know that he's done here, everyone moves on.


    1. Sometimes you need a warm body; this is where the best of the worst is still better than nothing. (Sadly.)

    2. Legal reasons. If a candidate is immediately turned down, they may assume it was because of their gender, race, religion, etc. and not because they failed a test.

    Fields that involve physical activity (electrician, plumber, etc.) failure is pretty obvious to spot. The light doesn't turn on, the faucet leaks all over, etc. Fields like software development aren't quite so easy. The candidate didn't even understand the test; how will they comprehend their failure?

    3. It's how the game is played. Don't whine.
  • Nobody 2008-05-07 11:45
    Chris:
    My initial thought would be that if they WERE good programmers they are keeping themselves reasonably up to date. Studying new practices, languages, and additional functionality. If a "good" programmer doesn't know about the std library in C++, then I would say they aren't that "good"


    Hmmm.... Well, perhaps it is about defining "good". A person may be a talented programmer, but not keep himself up to date on current practices. Part of being "good" to me involves being professional and motivated, which does involve being a student of your craft and keeping up with current tools and best practices. Often times, however, particularly with a "junior" hire, that can be cultivated. If you start without talent, though, there's only so much you can do.....
  • Anon 2008-05-07 11:47
    What, he knows Excel, Access and PowerPoint 2000 but not Word?
  • sc++by 2008-05-07 11:51
    Yeah ... you may want to actually declare x.
  • random_garbage 2008-05-07 11:53
    Chris Becke:
    I dont buy the std:: thing as a reason to terminate the interview. c++ is an ancient language, and many very very competent developers have been working with it since way before the standard template library - or, during the horrible time when most stl implementations were both notoriously unstable and ... not very standard.


    It's not that the interviewee didn't know how to use the std:: namespace, through having avoided it for years due to incompatibilities. She circled it because she didn't know what it was!!! That's exactly the opposite of "std:: is unstable, so I don't use it, and don't know what bugs it might introduce".
  • bramster 2008-05-07 11:53
    OedipusPrime:
    Russ:
    It is a bit of a trick question, as some junior developers might not know the difference between

    if (x==5)

    and

    if (x=5)



    Knowing the difference and being able to quickly spot the error are two different things, but I REALLY hope that even the juniorest guy in the room can tell you the difference between assignment and comparison operators.


    juniorest? WTF
  • NightGod 2008-05-07 11:55
    dpm:
    As soon as I've finished and installed the application, I delete the code.
    After 20+ years of working in this industry, I am ready to believe any damned thing at all that appears on this board, no matter how much people cry "shenanigans!" . . . but this one has me stumped. What could the interviewee possibly be thinking, what could he have meant? Not even the dumbest moron I've been forced to work against^H^H^H^H^Hwith would have actually deleted the source, but I can't imagine what he might have been referring to.
    The *only* thing I can think of here is that he means he deletes any personal copy he has of the source, so he's not tempted to reuse his own code.

    Wow...that didn't sound any better after typing it out.
  • Rookierookie 2008-05-07 11:57
    Knowledge of MS Office 2000 (Access, PowerPoint, Excel)


    Markedly missing is Microsoft Word.
  • bryan986 2008-05-07 11:58
    OedipusPrime:
    Russ:
    It is a bit of a trick question, as some junior developers might not know the difference between

    if (x==5)

    and

    if (x=5)



    Knowing the difference and being able to quickly spot the error are two different things, but I REALLY hope that even the juniorest guy in the room can tell you the difference between assignment and comparison operators.


    What about a developer that has only seen languages like VB where the equality and assignment operators look the same?

    They should know that assignment and equality operations are different, but they might also assume that other languages do it the same way.
  • Global Warmer 2008-05-07 12:00
    Russ:
    diaphanein:
    Russ:
    Ytram:
    ...and get the trick questions wrong, as did most people...


    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?


    No so people know how to find bugs in code. For example

    x=3;
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?


    5. Next?


    I really hope that was sarcasm


    I really hope yours is sarcasm because it is 5
  • Nerf Herder 2008-05-07 12:00
    You're all thinking way too much into this. He means that when he finishes a project, he deletes his local copy or rather probably does not save a copy. When he starts the next project, he does not leverage work he previously did, but instead starts each project from scratch.

    Hence the title of the article called Lets All Reinvent the Wheel. Sometimes you have to read slightly between the lines and not take things so friggin literally.

    dpm:
    As soon as I've finished and installed the application, I delete the code.
    After 20+ years of working in this industry, I am ready to believe any damned thing at all that appears on this board, no matter how much people cry "shenanigans!" . . . but this one has me stumped. What could the interviewee possibly be thinking, what could he have meant? Not even the dumbest moron I've been forced to work against^H^H^H^H^Hwith would have actually deleted the source, but I can't imagine what he might have been referring to.


  • Saaid 2008-05-07 12:02
    Alan:
    Russ:


    The answer should be 5. It is a bit of a trick question, as some junior developers might not know the difference between

    if (x==5)

    and

    if (x=5)



    How junior? Pre-school?

    I would call this a typo, I've been using C since the mid 80s and every once and a while I will type = when I mean ==. If you program in several languages, it's hard not to make this error, sometimes it's hard to see.
  • Skaven 2008-05-07 12:09
    Well, I do regret tossing that one in there with the level of nitpicking on this site. Of course I was referring to the languages that ASP.net covers as a framework and the fact that APS.net provides the just in time compiling, so it can be used in a similar manner to a scripting language. Yes, I realize that it can be pre-compiled, so the source code may not be available, but more often than not web developers use the just in time compiling.

    As for your comment about the code being 'delivered up to the client', where did you get the misinformed idea that all scripting languages are sent to the client? Ever hear of server side scripting?
  • FredSaw 2008-05-07 12:10
    OedipusPrime:
    I REALLY hope that even the juniorest guy in the room can tell you the difference between assignment and comparison operators.
    Depends on the language. In VB they are the same.
  • SomeCoder 2008-05-07 12:11
    bryan986:


    What about a developer that has only seen languages like VB where the equality and assignment operators look the same?

    They should know that assignment and equality operations are different, but they might also assume that other languages do it the same way.


    I would argue that someone that has only seen languages like VB should not be applying for a C++ job and is not qualified anyway.

    And I agree with a previous poster that you should learn C or C++ first. Other languages are easy to pick up if you know those two well.
  • Khanmots 2008-05-07 12:12
    gabba:
    Two excellent examples of WTFs on the part of those conducting the interviews. Asking people to criticize their own work is just stupid. It's your job to find out what's wrong with them; don't ask them to volunteer that information...


    What's wrong with them? Being willing to admit that you're human and don't know everything and hence make mistakes is wrong? Actually learning from those mistakes is wrong?

    I know I wouldn't want to hire a candidate who's unwilling to admit they're less than perfect... that's either hubris of the worst sort or they're dishonest. I would want to hire people who've shown me that they can learn from mistakes and not continue to make the same one over and over again. People make mistakes, it happens.

    If I were to not get a job because I explained that I learned from making a mistake... well... I'd be damn glad that I wasn't hired. It sounds like a horrible environment to work in. But then that's never happened. Hell, I even, voluntarily, brought up the fact that I flunked out of uni (while working on a ChemE degree) when I was interviewing after (finally) getting my CSE degree... and landed a hell of a first job.

    On a side note... asking someone to explain what they learned from past projects sounds like a great way to seperate those who think for themselves and can actually code from those that don't and simply know syntax.
  • FredSaw 2008-05-07 12:14
    bramster:
    juniorest? WTF
    He meant to say "most juniorized".
  • Jason 2008-05-07 12:19
    gabba:
    Two excellent examples of WTFs on the part of those conducting the interviews. Asking people to criticize their own work is just stupid. It's your job to find out what's wrong with them; don't ask them to volunteer that information. And asking people to find flaws in some artificial "Where's Waldo" bad code is equally stupid. Give them a realistic problem and ask them to solve it, already.


    Wrong. Simply flat out wrong.
    Examining your past performance to see where you went wrong and what you could have done better is the most critical component of self improvement.
    Nobody is perfect and nobody ever writes perfect code. Even well-written code can be improved on. To think otherwise leads to egos we all hate to work with as well as stagnation because you never think you have anything to improve on.

    I know I wouldn't want to work with someone who is not capable of self-reflection and analysis. Yes, this should only be a part of an interview that also includes realistic problems for them to solve but it should NEVER be left out.
  • real_aardvark 2008-05-07 12:20
    FredSaw:
    OedipusPrime:
    I REALLY hope that even the juniorest guy in the room can tell you the difference between assignment and comparison operators.
    Depends on the language. In VB they are the same.
    *Ahem* No they are not. They happen to be represented by the same symbol (which is idiotic) and are thus lexically the same. Unfortunately, and invisibly, they are syntactically distinct.

    Mind you, this would make for a whole 'nother set of useful interview questions if, for some obscure and twisted reason, you are seeking to hire a VB programmer.
  • FredSaw 2008-05-07 12:21
    real_aardvark:
    FredSaw:
    OedipusPrime:
    I REALLY hope that even the juniorest guy in the room can tell you the difference between assignment and comparison operators.
    Depends on the language. In VB they are the same.
    *Ahem* No they are not. They happen to be represented by the same symbol (which is idiotic) and are thus lexically the same. Unfortunately, and invisibly, they are syntactically distinct.

    Mind you, this would make for a whole 'nother set of useful interview questions if, for some obscure and twisted reason, you are seeking to hire a VB programmer.
    RA, I respect you more than to say, "What a dumbass reply." So I won't.
  • real_aardvark 2008-05-07 12:28
    bramster:
    juniorest? WTF
    I really can't imagine what you're complaining about on this one. Imagine you have two sets of people, and there's a one-to-one correspondence of first names between the sets. Joe (set 1) might be three years younger than Joe (set 2); Fred (set 2) might be two years younger than Fred (set 1); Bill (set 2) might be five years younger than Bill (set 1).

    Bill (set 2) is clearly the juniorest of them all. "Most junior" is not a sufficient description, because it fails to capture the relationship between the sets.

    This is clearly a useful and indeed necessary word, and you are obviously a Grammar Nazi of the most unreasoning kind. I shall report you to the relevant authorities.
  • RogerN 2008-05-07 12:30
    Russ:

    The answer should be 5. It is a bit of a trick question, as some junior developers might not know the difference between

    if (x==5)

    and

    if (x=5)


    See, this is exactly why I hate trick questions. There's frequently more than one trick. Far too often, the questioner screws something up unintentionally (such as the missing semicolon for x=3). Then I start to second-guess myself. Did he forget that semi-colon intentionally? Is that the trick? Or is it the improper assignment instead of quality test within the if statement?
  • rbonvall 2008-05-07 12:30
    Rookierookie:
    Knowledge of MS Office 2000 (Access, PowerPoint, Excel)
    Markedly missing is Microsoft Word.
    He/she prefers to use LaTeX, of course.
  • FredSaw 2008-05-07 12:31
    real_aardvark:
    "Most junior" is not a sufficient description, because it fails to capture the relationship between the sets.
    How 'bout "least senior"?

    I'm home sick today, by the way, so I can post at machine-gun rapidity and not feel guilty.
  • Rootbeer 2008-05-07 12:31
    mauve:
    Your average librarian doesn't know that any C++ book prior to 1998 is worthless.


    Except, I would assume, for understanding the millions of lines of C++ code that were written prior to 1998. Legacy code still exists in abundance.
  • Havok 2008-05-07 12:34
    FredSaw:
    real_aardvark:
    FredSaw:
    OedipusPrime:
    I REALLY hope that even the juniorest guy in the room can tell you the difference between assignment and comparison operators.
    Depends on the language. In VB they are the same.
    *Ahem* No they are not. They happen to be represented by the same symbol (which is idiotic) and are thus lexically the same. Unfortunately, and invisibly, they are syntactically distinct.

    Mind you, this would make for a whole 'nother set of useful interview questions if, for some obscure and twisted reason, you are seeking to hire a VB programmer.
    RA, I respect you more than to say, "What a dumbass reply." So I won't.


    i concur
  • real_aardvark 2008-05-07 12:37
    Chris Becke:
    I dont buy the std:: thing as a reason to terminate the interview. c++ is an ancient language, and many very very competent developers have been working with it since way before the standard template library - or, during the horrible time when most stl implementations were both notoriously unstable and ... not very standard.
    Thread up, thread down.

    Look: it's simple. If you want to hire a competent 1980's C++ programmer, use a time machine. If you want to hire a competent 2000's C++ programmer, ask them if they've read a book by Scott Meyers. (Not a plug, but relevant to the issue in question.)

    If you want to hire somebody who is going to work extensively with the STL, ask them about the STL.

    Why is this so hard to understand?
  • FredSaw 2008-05-07 12:38
    Skaven:
    Well, I do regret tossing that one in there with the level of nitpicking on this site.
    The level of nitpicking here does not exceed the level of compile-time error reporting. Get it right, or have it reported.
    Skaven:
    As for your comment about the code being 'delivered up to the client', where did you get the misinformed idea that all scripting languages are sent to the client? Ever hear of server side scripting?
    Um... so by your remark, you only meant to say that the compiled dll's are in the inaccessible bin folder down in the bowels of the physical web root... *cough* Yeah, I *cough* picked up on that.

    So, what happened to that whole sub-thread, anyway? It seems to have disappeared, at least from this client.
  • SuperousOxide 2008-05-07 12:41
    J_Random_Hacker:
    On the other hand, if the called function needs to modify the value for its own internal purposes (e.g. it wants to produce an uppercased version for searching some table), it is probably more efficient to modify a non-const value argument directly than to copy-construct a new local std::string variable from a const reference argument and then modify that.

    (Just to be clear, a non-const, pass-by-value parameter is a copy of the passed parameter so any modifications will not be seen by the calling function. There are many situations where this might be useful behaviour, such as the conversion to uppercase mentioned above.)


    Why is copying the variable to make the pass-by-value parameter more efficient than copying the variable to make a local variable?
  • snoofle 2008-05-07 12:43
    morry:
    I'd like to come up with some trick questions to ask a company in an interview some time.

    For any established organization:

    1. How many releases did you do in the past year?
    - too few = scope creep: wtf management
    - too many = either too "agile" or qty > quality
    2. Why did the person who vacated this position leave?
    - hedging: something to hide
    - he "moved on" - why so vague?
    - specific real-sounding answer: probably ok
    3. What was the last disaster that occurred and how it was handled
    - all hands on deck for 2 weeks: lack of DR planning or code (or staff) is WTF
    - 2 hours to find and fix: system probably stable
    4. How much training did the folks on your team receive last year?
    - < 1 week: they want to pick your brains but not invest in you as an asset of the company
    5. How much overtime is typical?
    - very little: good project scheduling/QA: code is stable
    - hours each day: poor planning, wtf code/staff/management
    6. Depending upon the business: what is the size of the sales/support staff w.r.t. development staff?
    - 100:1 - lots of customers: probably stable code
    - 1:10 - very new, possibly unstable code
    - possibly new project (might be a good thing)
    7. What is your DR setup?
    - "George goes home and fires up his laptop" - no DR: run!
    - "parallel servers, dbs, etc" - someone thought about it and management funded it
    8. May I see your wiring closet?
    - birds nest: danger danger danger
    - pc's stacked on a refridgerator with fans on top: run!
    - nice and clean - good network support
  • real_aardvark 2008-05-07 12:47
    FredSaw:
    real_aardvark:
    "Most junior" is not a sufficient description, because it fails to capture the relationship between the sets.
    How 'bout "least senior"?

    I'm home sick today, by the way, so I can post at machine-gun rapidity and not feel guilty.
    I'm working from home, and not (any more than usually) sick, so not only do I not feel guilty but I also feel a powerful need to go down the pub.

    On the same argument (and I'm quite proud of this argument -- it's not often I get to contradict my own most deeply cherished beliefs), "least senior" is effectively the antonym of "most junior". Visual Basic would no doubt assign the same symbol to both. "Seniorest" would also be an excellent term, were it not for the fact that it has probably been copyrighted by some mega-corporation (SoylentGreenCorp?) to describe their luxury range of care-assisted facilities, complete with an interesting suction mechanism on the toilets.

    I wasn't really getting at VB on the assignment/equality issue, btw. (Well,, not much. I still think it's a remarkably silly language design choice.) My point was that it offers up an entirely new set of interesting gotcha questions for interviews.

    I hear a pint of Theakston's Old Peculier singing strange songs of woe and insane attraction to me. Tie me to the Main Mast, quick!
  • real_aardvark 2008-05-07 12:55
    snoofle:
    morry:
    I'd like to come up with some trick questions to ask a company in an interview some time.

    For any established organization:

    1. How many releases did you do in the past year?
    - too few = scope creep: wtf management
    - too many = either too "agile" or qty > quality
    2. Why did the person who vacated this position leave?
    - hedging: something to hide
    - he "moved on" - why so vague?
    - specific real-sounding answer: probably ok
    3. What was the last disaster that occurred and how it was handled
    - all hands on deck for 2 weeks: lack of DR planning or code (or staff) is WTF
    - 2 hours to find and fix: system probably stable
    4. How much training did the folks on your team receive last year?
    - < 1 week: they want to pick your brains but not invest in you as an asset of the company
    5. How much overtime is typical?
    - very little: good project scheduling/QA: code is stable
    - hours each day: poor planning, wtf code/staff/management
    6. Depending upon the business: what is the size of the sales/support staff w.r.t. development staff?
    - 100:1 - lots of customers: probably stable code
    - 1:10 - very new, possibly unstable code
    - possibly new project (might be a good thing)
    7. What is your DR setup?
    - "George goes home and fires up his laptop" - no DR: run!
    - "parallel servers, dbs, etc" - someone thought about it and management funded it
    8. May I see your wiring closet?
    - birds nest: danger danger danger
    - pc's stacked on a refridgerator with fans on top: run!
    - nice and clean - good network support
    I always love that "Do you have any questions for us?" thing. If I had the balls, it would include all of the above. Sadly, it appears to be one more reflexive piece of crap, to be answered with something like "Yes, I was wondering how long you expect it will take for your flagship product to cure malaria/cause young girls to wet themselves in the streets/take over the world?"

    What I'd really like to ask is, "Ah ... well ... you've got me stumped there. What is the air-speed velocity of an unladen swallow?"

    And before anybody cares to ask me whether that's African or European, I'm off for a Theakston's.
  • WhiskeyJack 2008-05-07 12:55
    Some Interviewer:
    1. Sometimes you need a warm body; this is where the best of the worst is still better than nothing. (Sadly.)

    2. Legal reasons. If a candidate is immediately turned down, they may assume it was because of their gender, race, religion, etc. and not because they failed a test.

    Fields that involve physical activity (electrician, plumber, etc.) failure is pretty obvious to spot. The light doesn't turn on, the faucet leaks all over, etc. Fields like software development aren't quite so easy. The candidate didn't even understand the test; how will they comprehend their failure?

    3. It's how the game is played. Don't whine.


    Hey, I ain't whining - I got my job already. Every place that had me for an interview gave me an offer. I'm just thinking that it would be so much more practical (albeit less funny stories for sites like this) if people who are obviously unqualified, or have extreme quirks, to be told so. Might actually be an incentive for them to improve.

    Like the guy in the first story, the interviewer was ready to hire him until he said his last bit. It would be nice if the interviewer could have actually told him "I was ready to hire you until you said that last part. That's not how it's done in the industry, so, sorry..." The intent is to have these people walk out of the room thinking "Have I got it wrong? Do I need to change my way of thinking?" rather than "Bah, another jerk company that won't recognize me for the programming God that I am!"

    Granted you'll always have a few that think that way and nothing will change them, but for the rest, finding out WHY you didn't get the job should be a good teaching experience.
  • FredSaw 2008-05-07 12:58
    real_aardvark:
    I'm working from home, and not (any more than usually) sick, so not only do I not feel guilty but I also feel a powerful need to go down the pub.
    We (at my company) don't do "work from home" here... at least, not for pay, although we do all have VPN access (in the event of a late-night weekend emergency, don'tcha see). And I'll be damned if any of us could get away with going down to the (American equivalent of a) pub on the clock. Perhaps I should consider moving to the UK...
    real_aardvark:
    On the same argument (and I'm quite proud of this argument -- it's not often I get to contradict my own most deeply cherished beliefs), "least senior" is effectively the antonym of "most junior".
    (Sound of me flipping my lips:) Ehh, b'dee b'dee b'dee...
    real_aardvark:
    ...(SoylentGreenCorp?)...
    LOL! (literally, when I first read it)
    real_aardvark:
    Tie me to the Main Mast, quick!
    For a moment there I thought you were going to break out in the Aussie "Tie Me Kangaroo Down, Sport". But I see it's about those damned sirens. Speaking of which, If you missed out on the band Red Delicious with their song, "Siren", you really should look it up. Talk about your double entendres... whoa! The girl will have you ready to "throw yourself into her sea".
  • SomeCoder 2008-05-07 12:59
    snoofle:
    morry:
    I'd like to come up with some trick questions to ask a company in an interview some time.

    For any established organization:

    1. How many releases did you do in the past year?
    - too few = scope creep: wtf management
    - too many = either too "agile" or qty > quality
    2. Why did the person who vacated this position leave?
    - hedging: something to hide
    - he "moved on" - why so vague?
    - specific real-sounding answer: probably ok
    3. What was the last disaster that occurred and how it was handled
    - all hands on deck for 2 weeks: lack of DR planning or code (or staff) is WTF
    - 2 hours to find and fix: system probably stable
    4. How much training did the folks on your team receive last year?
    - < 1 week: they want to pick your brains but not invest in you as an asset of the company
    5. How much overtime is typical?
    - very little: good project scheduling/QA: code is stable
    - hours each day: poor planning, wtf code/staff/management
    6. Depending upon the business: what is the size of the sales/support staff w.r.t. development staff?
    - 100:1 - lots of customers: probably stable code
    - 1:10 - very new, possibly unstable code
    - possibly new project (might be a good thing)
    7. What is your DR setup?
    - "George goes home and fires up his laptop" - no DR: run!
    - "parallel servers, dbs, etc" - someone thought about it and management funded it
    8. May I see your wiring closet?
    - birds nest: danger danger danger
    - pc's stacked on a refridgerator with fans on top: run!
    - nice and clean - good network support


    Relatively good questions and results... IF the company tells the truth :) Specifically, I can see a company saying "Oh, overtime is rarely required" when in practice, if you work less than 65 hours in a week, you are "not a team player"
  • webhamster 2008-05-07 13:05
    FredSaw:
    Ytram:
    ...and get the trick questions wrong, as did most people...
    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?
    Perhaps, to see if/how they turn a trick?


    It's not a trick...it's an illusion. </gob>
  • UpNDown 2008-05-07 13:10
    Russ:
    No so people know how to find bugs in code. For example

    x=3
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?


    The correct answer, of course, is "What would you like it to be?"

    After all, the type of x is not given. So I can declare x to be of type MyClass, which happens to have overridden operators that let me control this flow however I want.

    Now, my c++ is rusty, so I'll not attempt to give an example, I'm sure someone else is up to it.
  • obediah 2008-05-07 13:12
    Russ:
    It is a bit of a trick question, as some junior developers might not know the difference between

    if (x==5)

    and

    if (x=5)



    Lollercaust!1! A careless developer may not notice the typo, but if you don't know the difference between == and = you aren't any level of C developer. Might as well say some junior surgeons don't know the difference between heat and a heart.
  • Survey User 2338 2008-05-07 13:13
    If RA is interviewing compilers this question makes perfect sense.
  • FredSaw 2008-05-07 13:16
    Survey User 2338:
    If RA is interviewing compilers this question makes perfect sense.
    I... he... y... uh...

    Huh? What question?
  • Pete Repete 2008-05-07 13:16
    UpNDown:
    Russ:
    No so people know how to find bugs in code. For example

    x=3
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?


    The correct answer, of course, is "What would you like it to be?"

    After all, the type of x is not given. So I can declare x to be of type MyClass, which happens to have overridden operators that let me control this flow however I want.

    Now, my c++ is rusty, so I'll not attempt to give an example, I'm sure someone else is up to it.


    Also there is a missing semi-colon.
  • GF 2008-05-07 13:21
    gabba:
    Two excellent examples of WTFs on the part of those conducting the interviews. Asking people to criticize their own work is just stupid. It's your job to find out what's wrong with them; don't ask them to volunteer that information. And asking people to find flaws in some artificial "Where's Waldo" bad code is equally stupid. Give them a realistic problem and ask them to solve it, already.

    Spoken like someone who never makes mistakes and always starts his code from scratch...
  • FredSaw 2008-05-07 13:21
    Pete Repete:
    The correct answer, of course, is "What would you like it to be?"
    Oh, yeah, I remember that from my freshman Sycophantics 101.
  • GF 2008-05-07 13:24
    SomeCoder:

    Relatively good questions and results... IF the company tells the truth :) Specifically, I can see a company saying "Oh, overtime is rarely required" when in practice, if you work less than 65 hours in a week, you are "not a team player"

    I used to fall for that. If you're valuable to the company, they'll accept that your work is not your life. Otherwise, not, get out as soon as you can.
  • Velko 2008-05-07 13:27
    Never make any mistaeks.
    -- Anonymous, in a mail discussion about to a kernel bug report.
  • FredSaw 2008-05-07 13:30
    Velko:
    Never make any mistaeks.
    -- Anonymous, in a mail discussion about to a kernel bug report.
    Wow, what a dumbass! Can you spell "looser"?
    -- Not anonymous, in the middle of a forum confrontation, but I will keep him so anyay, bless his uneducated little heart.
  • tanisha 2008-05-07 13:31
    Ytram:
    ...and get the trick questions wrong, as did most people...


    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?


    The point is, that in Israel , where the post came from, the idea of an interview is to prove to the candidate that the interviewer is smarter than him/her. You think I'm kidding, but I'm not. In general, job candidates are considered scum of the earth and treated as such. There are entire web sites and discussion groups dedicated to this. People even came up with protest posters. Regretably, it's all in Herbrew.
  • FredSaw 2008-05-07 13:34
    tanisha:
    Regretably, it's all in Herbrew.
    Well, at least Israel is starting to get with the Women's Lib thing.
  • DZ-Jay 2008-05-07 13:41
    Jason:
    gabba:
    Two excellent examples of WTFs on the part of those conducting the interviews. Asking people to criticize their own work is just stupid. It's your job to find out what's wrong with them; don't ask them to volunteer that information. And asking people to find flaws in some artificial "Where's Waldo" bad code is equally stupid. Give them a realistic problem and ask them to solve it, already.


    Wrong. Simply flat out wrong.
    Examining your past performance to see where you went wrong and what you could have done better is the most critical component of self improvement.
    Nobody is perfect and nobody ever writes perfect code. Even well-written code can be improved on. To think otherwise leads to egos we all hate to work with as well as stagnation because you never think you have anything to improve on.

    I know I wouldn't want to work with someone who is not capable of self-reflection and analysis. Yes, this should only be a part of an interview that also includes realistic problems for them to solve but it should NEVER be left out.


    So, what you are saying is that you are unwilling to entertain the idea that *maybe* someone could have enough time, insight, or perhaps even the assistance of a good enough team, in a past project that would lead to a well designed and executed implementation of which he has no regrets?

    If you only look for mediocrity in your developers, that's probably what you'll find.

    -dZ.
  • German 2008-05-07 13:51
    dpm:
    Not even the dumbest moron I've been forced to work against^H^H^H^H^Hwith would have actually deleted the source, but I can't imagine what he might have been referring to.


    The dumbest morons need their source code so their bugs can be fixed. However, this guy made no mistakes, and his applications were made in the best possible way. In that case, source code is a waste of disk space.
    Don't try it unless you have independently abilities.
  • Dave Grammar 2008-05-07 13:54
    A compiler error, I hope.

  • what 2008-05-07 13:59
    If she said "I don't know what std:: is" that's a whole other can of worms than, "I'm not familiar with this namespace, so it may or may not be wrong since I don't have the std:: namespace in the example code."
  • Anonymous 2008-05-07 14:01
    DZ-Jay:
    So, what you are saying is that you are unwilling to entertain the idea that *maybe* someone could have enough time, insight, or perhaps even the assistance of a good enough team, in a past project that would lead to a well designed and executed implementation of which he has no regrets?

    Then the candidate shall explain why he/she thinks it was a complete success, e.g. which pitfalls they moved around by careful planning.

    Apart from that, it's highly unlikely that said candidate delivered perfect code from the first time he/she touched a keyboard, so there is bound to be some code that he/she is no more confident with today.
  • Spectre 2008-05-07 14:03
    Here's a trick question. Observe the following snippet, which is supposed to set every element of the array to 42. N is a positive integer.


    short a[N];

    for (short * p = a + N - 1; p >= a; --p)
    *p = 42;


    This code, besides being literally backwards, looks normal, right? Right?

    1) Why is this code wrong from the theoretical point of view? Bonus points for citing relevant portion of the standard.
    2) Name a real scenario in which the code would b0rk.
    3) How would you do the task (that is, fill an array with 42's) in C? In C++?
  • too_many_usernames 2008-05-07 14:05
    Russ:
    It is a bit of a trick question, as some junior developers might not know the difference between

    if (x==5)

    and

    if (x=5)



    This is why you always write comparison statements against literals:

    if(5 == x){...}

    Very hard to get incorrect assignment operations wrong written this way. So hard, in fact, it would require discovery of a compiler that doesn't work properly.
  • Disgruntled DBA 2008-05-07 14:20
    too_many_usernames:
    Russ:
    It is a bit of a trick question, as some junior developers might not know the difference between

    if (x==5)

    and

    if (x=5)



    This is why you always write comparison statements against literals:

    if(5 == x){...}

    Very hard to get incorrect assignment operations wrong written this way. So hard, in fact, it would require discovery of a compiler that doesn't work properly.


    I believe "FORTRAN" is the word you are looking for there ;-).
  • Walleye 2008-05-07 14:28
    Disgruntled DBA:
    too_many_usernames:
    Russ:
    It is a bit of a trick question, as some junior developers might not know the difference between

    if (x==5)

    and

    if (x=5)



    This is why you always write comparison statements against literals:

    if(5 == x){...}

    Very hard to get incorrect assignment operations wrong written this way. So hard, in fact, it would require discovery of a compiler that doesn't work properly.


    I believe "FORTRAN" is the word you are looking for there ;-).



    Brillant!
  • Some 2008-05-07 14:36
    Spectre:
    Here's a trick question. Observe the following snippet, which is supposed to set every element of the array to 42. N is a positive integer.


    short a[N];

    for (short * p = a + N - 1; p >= a; --p)
    *p = 42;


    This code, besides being literally backwards, looks normal, right? Right?

    1) Why is this code wrong from the theoretical point of view? Bonus points for citing relevant portion of the standard.
    2) Name a real scenario in which the code would b0rk.
    3) How would you do the task (that is, fill an array with 42's) in C? In C++?


    At the last loop p will run outside the "a" momory-section and will cause Memory Access error...
  • diaphanein 2008-05-07 14:38
    [quote user="FredSawWe (at my company) don't do "work from home" here... at least, not for pay, although we do all have VPN access (in the event of a late-night weekend emergency, don'tcha see). And I'll be damned if any of us could get away with going down to the (American equivalent of a) pub on the clock. Perhaps I should consider moving to the UK...[/quote]

    Depends on who/where you work. Myself and some of my coworkers routinely go to the pub (and yes, I'm an American, in America) and throw down a few pints. My director knows, too. As he told us one day, "I don't care if you go out for a few drinks, but answer your fucking phone." To which I responded, I would have had it rang, and proceeded to show him that I had no missed calls.

    Oh, and as for being on the clock, if you're an exempt, salaried employee - you're always on the clock.
  • dpm 2008-05-07 15:01
    snoofle:
    morry:
    I'd like to come up with some trick questions to ask a company in an interview some time.

    For any established organization: {...}

    That's a good list, but the one I always ask is "what do you use for source code control?"

    There are some good answers and some poor ones, depending on the scale of the projects involved. But the two that always raise red flags are "none" and "we use a system we developed in-house". Danger Will Programmer!
  • Spectre 2008-05-07 15:13
    Some:

    At the last loop p will run outside the "a" momory-section and will cause Memory Access error...


    No, because we don't dereference it.
  • diaphanein 2008-05-07 15:23
    Spectre:
    Some:

    At the last loop p will run outside the "a" momory-section and will cause Memory Access error...


    No, because we don't dereference it.


    You do if a==0. Your loop will also never terminate in that case (at least not without an access violation/segfault). That being said, it should never occur as address "0x0" is generally reserved.

    Instead of comparing p >= a, I would suggest the following:

    short a[N];
    for (short *p = a + N - 1, *end = a - 1; p != end; --p)
    *p = 42;

    This is essentially how rbegin/rend work in STL. rend symbolically points to the element *before* the beginning of a container.
  • Manic Mailman 2008-05-07 15:23
    Spectre:
    Here's a trick question. Observe the following snippet, which is supposed to set every element of the array to 42. N is a positive integer.


    short a[N];

    for (short * p = a + N - 1; p >= a; --p)
    *p = 42;


    This code, besides being literally backwards, looks normal, right? Right?

    1) Why is this code wrong from the theoretical point of view? Bonus points for citing relevant portion of the standard.
    2) Name a real scenario in which the code would b0rk.
    3) How would you do the task (that is, fill an array with 42's) in C? In C++?


    1) The problem is that --p is undefined when p == &a[0]. The relevant portion of the standard (ISO/IEC 9899:1999) is 6.5.6 Paragraph 8. Other versions of the standard (C or C++) have similar paragraphs, just with different numbering. I admit I had to look up the section in the standard, so I wouldn't have gotten this in the interview.

    2) I suppose some scenarios when this code would b0rk is when (&a[0] < sizeof( short)). Not too likely, but could maybe happen if you're on a architecture where alignment issues don't matter and aren't taken into account by the compiler and the short array happens to be located at address 1. Or you could be working on an architecture where the compiler can locate objects at address 0 - just because the NULL pointer is represented by 0 in C source code does not mean that address 0 is off limits to an implementation. The only restriction is that the null pointer constant cannot compare equal to a pointer to any object or function - a compiler is free to do some dirty work behind the scenes so that this holds true for pointers to objects or functions whose bits happen to be all zeros (not that I'm aware of any actual compiler that does this).

    3) here's one way to init the array that I believe is correct
        
    
    short a[N];
    for (size_t i = 0; i < N; ++i) {
    a[i] = 42;
    }


    I'm not sure what might be different in C except that the declaration for i would have to be located prior to the 'for' statement.

    Do I get the job?

  • James Schend 2008-05-07 15:28
    WhiskeyJack:
    So my question for the interviewers is, in situations like these, why do you have to keep stringing along the candidate, say "we'll call you if you get the position", etc., even though in their minds they've already cemented their decision as a 100% no?

    With candidates like these you should be able to just say "Well, um, that's not really what we're looking for, so thank you for your time". Get it over with quickly, let the interview candidate know that he's done here, everyone moves on.


    I think most IT companies *do* do this. At least, I've been told several times when interviewing that if the candidate is a clear thumbs down to simply send them home after my segment of the interview and save everyone.

    The problem I think is that most people want to get second opinions, thinking that a later interviewer might have a different experience. Despite having that policy, I've only witnessed it happen once the years I've been working here.
  • LEGO 2008-05-07 15:33
    FredSaw:
    Ytram:
    ...and get the trick questions wrong, as did most people...
    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?
    Perhaps, to see if/how they turn a trick?


    Don't interviews of _that_ nature consist solely of negotiating a "rate"?
  • Anonymously Yours 2008-05-07 15:52
    "besides, I couldn't go back and rework a project anyway. As soon as I've finished and installed the application, I delete the code. I like to start every project with a clean slate, I don't believe in copying from what I did previously. I just start it over brand-new!"
    Imagine if he was an automotive engineer. "Besides, I couldn't go back and change the operations anyways. As soon as the first car rolled out I burned down the factory. I like to start every job with a clean slate and a new mark on my criminal record."

    Perhaps he was one of the contractors who first answered the Call of Codethulu...
  • Anonymously Yours 2008-05-07 15:55
    DZ-Jay:
    So, what you are saying is that you are unwilling to entertain the idea that *maybe* someone could have enough time, insight, or perhaps even the assistance of a good enough team, in a past project that would lead to a well designed and executed implementation of which he has no regrets?

    If you only look for mediocrity in your developers, that's probably what you'll find.

    -dZ.
    What use is a developer who's never worked in a less-than-ideal environment?
  • SomeCoder 2008-05-07 15:59
    Manic Mailman:

    3) here's one way to init the array that I believe is correct
        
    
    short a[N];
    for (size_t i = 0; i < N; ++i) {
    a[i] = 42;
    }


    I'm not sure what might be different in C except that the declaration for i would have to be located prior to the 'for' statement.

    Do I get the job?



    I think you're right... it's been a while since I've done C but I believe you'd have to say:

        
    
    short a[N];
    size_t i = 0;
    for (; i < N; ++i) {
    a[i] = 42;
    }


    Again, it's been a while so I could be wrong.
  • mxsscott 2008-05-07 16:03
    dpm:
    I always ask is "what do you use for source code control?"

    There are some good answers and some poor ones, depending on the scale of the projects involved. But the two that always raise red flags are "none" and "we use a system we developed in-house". Danger Will Programmer!


    What about RCS for a decent sized project? After years of CVS and Subversion, I get to use RCS... is it wrong that after a few months I actually like its rawness? (Don't worry, it's getting ditched soon).
  • Spectre 2008-05-07 16:17
    Damn, I didn't expect this one to be solved so quickly. 8=]

    Manic Mailman:

    1) The problem is that --p is undefined when p == &a[0]. The relevant portion of the standard (ISO/IEC 9899:1999) is 6.5.6 Paragraph 8. Other versions of the standard (C or C++) have similar paragraphs, just with different numbering. I admit I had to look up the section in the standard, so I wouldn't have gotten this in the interview.


    Bingo.


    2) I suppose some scenarios when this code would b0rk is when (&a[0] < sizeof( short)).


    You mean sizeof(short *).


    Not too likely, but could maybe happen if you're on a architecture where alignment issues don't matter and aren't taken into account by the compiler and the short array happens to be located at address 1. Or you could be working on an architecture where the compiler can locate objects at address 0 - just because the NULL pointer is represented by 0 in C source code does not mean that address 0 is off limits to an implementation. The only restriction is that the null pointer constant cannot compare equal to a pointer to any object or function - a compiler is free to do some dirty work behind the scenes so that this holds true for pointers to objects or functions whose bits happen to be all zeros (not that I'm aware of any actual compiler that does this).


    Agreed. And there is a real-world example. Hint: the system I'm talking about was widespread about, say, 15 years ago.


    3) here's one way to init the array that I believe is correct
        
    
    short a[N];
    for (size_t i = 0; i < N; ++i) {
    a[i] = 42;
    }


    I'm not sure what might be different in C except that the declaration for i would have to be located prior to the 'for' statement.


    Yeah, that's obviously correct; but for C++ I was hoping for a more standard library-esque solution. ;-)


    Do I get the job?



    Uhm, yeah, sure! As soon as I start my own company, that is.
  • Some 2008-05-07 16:23
    Actually integer positive means that the value is >0.
  • real_aardvark 2008-05-07 16:41
    Some:
    Actually integer positive means that the value is >0.
    Only if you don't live in Bizarro World.

    Which is basically where the rest of us live.
  • Jay 2008-05-07 17:23
    I thought the "what would you go back and re-work" was an excellent interview question. When I read it I immediately started thinking of how I would answer it. If I was interviewing someone and used that question and the candidate replied that he had never made a mistake, that every project he had ever worked on had been perfect, the best possible interpretation I could put on it would be that he was nervous.

    I think it's quite different from the lame question I've gotten in numerious interviews, "What is your greatest weakness?" Do they really expect me to volunteer some serious character flaw? The last time someone asked me that, I got pensive and said, "Let's see, I think I've put prison behind me, and the drugs don't really interfere with my work ..." Then I laughed and brushed it off.
  • Numeromancer 2008-05-07 17:34
    FAIL!
  • Bob N Freely 2008-05-07 17:56
    To be fair, the bullet point stated "wit minor errors." Instaed of "wit zero errors."
  • WW 2008-05-07 18:17
    Russ:
    Russ:
    diaphanein:
    Russ:
    Ytram:
    ...and get the trick questions wrong, as did most people...


    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?


    No so people know how to find bugs in code. For example

    x=3;
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?


    5. Next?


    I really hope that was sarcasm


    Actually my bad.. haven't had my morning coffee yet.

    The answer should be 5. It is a bit of a trick question, as some junior developers might not know the difference between

    if (x==5)

    and

    if (x=5)



    If only it was just junior developers. I've made that same damnfool mistake in my own code *mumble* times, in more than one language.
  • fist-poster 2008-05-07 18:18
    UpNDown:
    Russ:
    No so people know how to find bugs in code. For example

    x=3
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?


    The correct answer, of course, is "What would you like it to be?"

    After all, the type of x is not given. So I can declare x to be of type MyClass, which happens to have overridden operators that let me control this flow however I want.

    Now, my c++ is rusty, so I'll not attempt to give an example, I'm sure someone else is up to it.


    Ok:
    #include <iostream>
    using std::cout;

    struct False
    {
    False() {}
    False(int) {}
    operator bool() const { return false; }
    };

    int main()
    {
    False x;
    x=3;
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";
    }
    Do I get the job?
  • Carnildo 2008-05-07 18:37
    Spectre:
    Manic Mailman:

    Not too likely, but could maybe happen if you're on a architecture where alignment issues don't matter and aren't taken into account by the compiler and the short array happens to be located at address 1. Or you could be working on an architecture where the compiler can locate objects at address 0 - just because the NULL pointer is represented by 0 in C source code does not mean that address 0 is off limits to an implementation. The only restriction is that the null pointer constant cannot compare equal to a pointer to any object or function - a compiler is free to do some dirty work behind the scenes so that this holds true for pointers to objects or functions whose bits happen to be all zeros (not that I'm aware of any actual compiler that does this).


    Agreed. And there is a real-world example. Hint: the system I'm talking about was widespread about, say, 15 years ago.


    Good ol' x86 segmented memory. That was exciting to program for.
  • Jason 2008-05-07 18:56
    DZ-Jay:
    Jason:
    gabba:
    Two excellent examples of WTFs on the part of those conducting the interviews. Asking people to criticize their own work is just stupid. It's your job to find out what's wrong with them; don't ask them to volunteer that information. And asking people to find flaws in some artificial "Where's Waldo" bad code is equally stupid. Give them a realistic problem and ask them to solve it, already.


    Wrong. Simply flat out wrong.
    Examining your past performance to see where you went wrong and what you could have done better is the most critical component of self improvement.
    Nobody is perfect and nobody ever writes perfect code. Even well-written code can be improved on. To think otherwise leads to egos we all hate to work with as well as stagnation because you never think you have anything to improve on.

    I know I wouldn't want to work with someone who is not capable of self-reflection and analysis. Yes, this should only be a part of an interview that also includes realistic problems for them to solve but it should NEVER be left out.


    So, what you are saying is that you are unwilling to entertain the idea that *maybe* someone could have enough time, insight, or perhaps even the assistance of a good enough team, in a past project that would lead to a well designed and executed implementation of which he has no regrets?

    If you only look for mediocrity in your developers, that's probably what you'll find.

    -dZ.


    I don't believe in perfection. I do believe in striving for it because that's how we get better. Even if you are completely satisfied with a well designed and executed implementation there is probably something which could have been done even better. Especially when, as in the question, you include new insights or technology that experience and time has given. It's not bad to write imperfect code. We're humans, we're imperfect and imperfect code can still be great and work with no problems.

    Additionally, the question looks back over the programmer's whole body of experience. If someone honestly thinks they never wrote some code that needed improvement I don't want to work with them.

    Even those born with great aptitude must develop their skill by learning from many failures.
  • Gus 2008-05-07 19:08
    "Exclusive Research Skill with Details"? Is that like "Friends with Benefits" or a "Massage with Happy Ending"?
  • corey 2008-05-07 19:25
    You are all so silly! No need to add a semicolon. You are all forgetting that this is just a code fragment (notice how x isn't defined). The correct code looks like this (with the missing part in red):



    #include <iostream>
    using namespace std;
    void main () {
    int x;

    #define if ;if

    x=3
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    #undef if
    }





    which will of course output "5" as expected. Sheesh. Doesn't anyone teach the preprocessor anymore? :-P

  • Ken Sykora 2008-05-07 19:35
    The last one's a little sketch...

    I'm all for having programmers that come in for interviews write code, but any good interviewer/technology manager should know that a good programmer doesn't need to know the language you use at your organization, and they shouldn't be held to the (exact) syntax. A good programmer has many other great skills (logic!!!, general software design, general debugging skills, knowledge of algorithms/runtimes, the inner workers of managed languages, pointers, etc.) will become fluent and an expert in a language/framework in a matter of weeks/months and finding someone that is fluent in the language AND has all the other great skills of being a good programmer is just an added bonus.

    But to be fair, if the interviewee claims to have Excellent knowledge of C++, has used it everyday in the last year, and claims to be able to teach C++ to a 4-year-old in 2 hours, you would hope they know what std:: represents.
  • Jon W 2008-05-07 19:51
    It is a fact of California labor law (and probably other US states -- haven't checked) that, if you're an "exempt" employee (aka "salaried," meaning you don't get paid by the hour, and thus don't get overtime pay), then the company cannot refuse to pay you your regular salary for any day where you did at least some work. That's right; if you're salaried, then flextime comes with the job!

    The company can still terminate employment for cause (or not), of course, but if the company attempts to order overtime, then the company has two choices:

    1) realize that not everyone will work the overtime
    or
    2) convert employees to non-exempt, and pay overtime

    Also note that there are specific requirements for employees to count as "exempt" and thus not get overtime pay, and ALL of those requirements must be fulfilled for the position to be exempt. This, of course, was part of the big lawsuit against Electronic Arts a few years ago, having to do with overtime for game developers.

    Personally, I wouldn't work at a place where an hour here or there, one way or the other, was a big deal. There are more important things to focus on, and if the organization is myopic, there are likely better opportunities for my talents to grow.

    Btw: If you want to base any life-altering decision on something you read on a web site, then I suggest you first double-check with a lawyer in your jurisdiction, as web sites weren't licensed to practice law last I checked ;-)
  • alegr 2008-05-07 19:57
    "Oh, that..." she said, "I didn't know what this 'std' means."

    That's what you get for unsafe hex!
  • Cronus 2008-05-07 20:04
    FredSaw:
    Velko:
    Never make any mistaeks.
    -- Anonymous, in a mail discussion about to a kernel bug report.
    Wow, what a dumbass! Can you spell "looser"?
    -- Not anonymous, in the middle of a forum confrontation, but I will keep him so anyay, bless his uneducated little heart.


    While I enjoyed the sarcasm ( a la "looser"), even the most professional worker can miss a typo (or two) in a report. Or even a brief sentence commenting on said misspelling.

    However, this statement ("Never make any mistaeks.") is taken out of context. Its funny out of context, or if there was an "I" in front of the sentence. However, seeing that its a "kernel bug report." couldn't the statement be instructional, thereby warning about the dangers that a mistake might incur?

    (Don't flame too hard, still studying Comp Sci)

  • Ragnax 2008-05-07 20:11
    Manic Mailman:

    3) here's one way to init the array that I believe is correct
        
    
    short a[N];
    for (size_t i = 0; i < N; ++i) {
    a[i] = 42;
    }


    I'm not sure what might be different in C except that the declaration for i would have to be located prior to the 'for' statement.

    Do I get the job?



    I agree on your points 1) and 2), but on point 3) my opinion differs for the C++ case: you should imho not be using C arrays at all. You should instead be using


    std::vector<short> a(N, 42);


    For the C case I agree with you again, as I'm not sure how I'd initialize the array other than with an iterated assignment.

    Certainly I wouldn't be using a memset as that operates on the byte level rather than the short level and the resulting code would then only operate correctly if the short type happened to be one byte large on the target platform/architecture/compiler/etc. and byte and short value 42 would both share the same representation at the byte level. Meaning; portability nightmare.
  • PrepositionJoe 2008-05-07 20:22
    I feel the need to say that the "type wit no mistakes" thing is because nobody ever proof-reads any more! They spell-check instead and think it's the same thing.

    So, if it had been "type wiht no mistakes", it would have been found, but guess what, some typos are words -- just not the intended word.

    Same goes double for people who don't know the difference between "they're", "their" and "there". All good words, spelled correctly. But only one of them is right for a given context.

    The one I see all the time, and it drives me crazy, is people who don't know the difference between "lose" and "loose". Once you start noticing it, it's everywhere!
  • The Enterpriser 2008-05-07 20:24
    FredSaw:
    bramster:
    juniorest? WTF
    He meant to say "most juniorized".


    juniorest n.
    Someone who more juniorer than the most juniorized of juniors.
  • David Schwartz 2008-05-07 20:30
    "If you want to hire somebody who is going to work extensively with the STL, ask them about the STL.
    Why is this so hard to understand?"

    Maybe, if you're hiring someone for a week or two. But if you're looking for a serious developer who is going to work on projects for you for years, having to learn the STL is no big deal. A programmer who has dealt with a large number of other libraries can pick up the STL in no time.

    Which would you rather have, someone who knows the STL very well and only the STL, or someone who doesn't know the STL but can pick up new libraries in a week or two?

    Which is the better long-term investment?
  • UpNDown 2008-05-07 20:31
    fist-poster:

    Ok:
    #include <iostream>
    using std::cout;

    struct False
    {
    False() {}
    False(int) {}
    operator bool() const { return false; }
    };

    int main()
    {
    False x;
    x=3;
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";
    }
    Do I get the job?


    Looks good to me, although I haven't tried to run it. I was thinking more on the lines of redefining the assignment operator. In C, the result of an assignment expression is the value of the right hand side. In C++ you have more leeway :)
  • Russ 2008-05-07 20:33
    Listen, I'm just an ignorant, unattractive ColdFusion developer and I could probably learn the STL given a week or two.
  • chrismcb 2008-05-07 21:43
    too_many_usernames:
    Russ:
    It is a bit of a trick question, as some junior developers might not know the difference between

    if (x==5)

    and

    if (x=5)



    This is why you always write comparison statements against literals:

    if(5 == x){...}

    Very hard to get incorrect assignment operations wrong written this way. So hard, in fact, it would require discovery of a compiler that doesn't work properly.


    Actually thats why you use a modernday compiler to tell you that you've done this.
    5 == x looks awkward because it is. You aren't seeing if the value 5 is the same as x, you are seeing if the value of x is 5.
  • Edward Royce 2008-05-07 23:19
    RogerN:
    Russ:

    The answer should be 5. It is a bit of a trick question, as some junior developers might not know the difference between

    if (x==5)

    and

    if (x=5)


    See, this is exactly why I hate trick questions. There's frequently more than one trick. Far too often, the questioner screws something up unintentionally (such as the missing semicolon for x=3). Then I start to second-guess myself. Did he forget that semi-colon intentionally? Is that the trick? Or is it the improper assignment instead of quality test within the if statement?


    *shrug* personally I'd be wondering why the IDE and/or compiler hadn't picked up on an assignment in an if() statement.
  • Edward Royce 2008-05-07 23:24
    FredSaw:
    tanisha:
    Regretably, it's all in Herbrew.
    Well, at least Israel is starting to get with the Women's Lib thing.


    And beer!

    Believe it or not but there really is a "He'Brew" beer. Website at www.schmaltz.com if you're interested.

    L'Chaim!
  • Edward Royce 2008-05-07 23:28
    Hmmmm.

    The question I like to ask:

    1. What is the source code repository used on the project.

    2. What is the bug tracking software.

    ...

    I'm amazed at how many times the answer is, in order, "none" and "Excel".
  • The Enterpriser 2008-05-08 00:10
    Edward Royce:
    *shrug* personally I'd be wondering why the IDE and/or compiler hadn't picked up on an assignment in an if() statement.


    All good coders use vi.. didn't you know?
  • Kuba 2008-05-08 01:55
    Some:
    Spectre:
    Here's a trick question. Observe the following snippet, which is supposed to set every element of the array to 42. N is a positive integer.


    short a[N];

    for (short * p = a + N - 1; p >= a; --p)
    *p = 42;


    This code, besides being literally backwards, looks normal, right? Right?

    1) Why is this code wrong from the theoretical point of view? Bonus points for citing relevant portion of the standard.
    2) Name a real scenario in which the code would b0rk.
    3) How would you do the task (that is, fill an array with 42's) in C? In C++?


    At the last loop p will run outside the "a" momory-section and will cause Memory Access error...


    Nope. At the last loop the p will be equal to a. Methinks.

    The problem is that incrementing a pointer one past the end of the allocated memory area is an undefined operation per standard (IIRC). a+N-1 does not need to be optimized, it may literally take address of the array, increment it by N elements, and then move back one element. On most platforms this will work as you expect it to. But it's not guaranteed to.

    As for filling the array in C, there's no standard way IIRC. If sizeof(char)==sizeof(short) then memset will work. In C++, there's std::fill.

    I don't think there are real scenarios where the code would b0rk, unless you're on some crazy architecture. Maybe some big iron would mind such code. I mean architectures contorted enough to have a dereferenceable (w/o violations) NULL pointers.

    I can't think of a commonplace "consumer" architecture where pointer arithmetic isn't done modulo some power of two, and pointers can't store crap without further ado. I'd have to look up how Turbo C did pointer arithmetic, but in all models I think this would still work as you expect, even if the segment registers would be tweaked along the way.

    Am I missing something obvious (it's late here)?
  • tsmith 2008-05-08 02:35
    "Oh, that..." she said, "I didn't know what this 'std' means."

    "I see," I said, and ended the interview immediately.

    That's pretty harsh. Did she not understand the concept of a namespace? What about polymorphism, operator overloading, virtual functions, is-a versus has-a, or other object-oriented concepts? Or did you end the interview before you could find out?

    Tool.
  • Filthy_Liar 2008-05-08 04:14
    Kuba:

    Nope. At the last loop the p will be equal to a. Methinks.

    Nope. In order for loop to break the comparison
    p >= a
    must evaluate to false. Thus p must have decremented to a pointer value before the array.

    The problem is that incrementing a pointer one past the end of the allocated memory area is an undefined operation per standard (IIRC). a+N-1 does not need to be optimized, it may literally take address of the array, increment it by N elements, and then move back one element. On most platforms this will work as you expect it to. But it's not guaranteed to.


    The concern of a+N-1 does not actually apply to this case. The calculation will be correct even if a[] takes up the last N addressable words (which is why the spec makes *(a+N) undefined to begin with).

    The problem with the original code was
    --p
    . After the last loop, when p == &a[0], there is no gaurantee that --p will result in a p value less than &a[0]. Specifically if &a[0] = 0 (a[0] is the first addressable word), then the last --p will result in p much larger than a since pointers are unsigned.

    If sizeof(char)==sizeof(short) then memset will work.


    I don't think that matters,
    memset(a,42,sizeof(short)*N);
    should always work.

    I don't think there are real scenarios where the code would b0rk, unless you're on some crazy architecture.


    If &a[0] < sizeof(short *) then the pointer arithmetic on p will underflow causing p to have a very large value. I'm not sure which OS would give you a data segment with a virtual address starting at 0x00000, but it is conceivable and it would die.


    Am I missing something obvious (it's late here)?


    I wouldn't call it obvious.
  • Filthy_Liar 2008-05-08 04:25
    tsmith:
    "Oh, that..." she said, "I didn't know what this 'std' means."

    "I see," I said, and ended the interview immediately.

    That's pretty harsh. Did she not understand the concept of a namespace? What about polymorphism, operator overloading, virtual functions, is-a versus has-a, or other object-oriented concepts? Or did you end the interview before you could find out?

    Tool.


    Contrary to what was stated, their standards are not "immensely high", they are "exclusive." They may be high as well, but the primary effect is exclusivity. There is a difference.

    Most employers make this mistake. They will pass over extraordinarily capable candidates because "they didn't have enough knowledge of Specific Technology X." I'm sure most employers would turn down Donald Knuth for a job writing Ruby code because he didn't have specific knowledge of Ruby even though he is one of the most renowned computer scientists in the world.
  • AdT 2008-05-08 05:29
    SuperousOxide:
    Why is copying the variable to make the pass-by-value parameter more efficient than copying the variable to make a local variable?


    Because the pass-by-value parameter is constructed by the calling function, saving one copy operation in some cases. For instance:


    void twistAndPrint(const std::string& thestring);

    void readTwistAndPrint()
    {
    std::string input;
    std::cin >> input;
    twistAndPrint(input);
    }


    This will create an empty string, fill the string using the stream operator >>, pass a reference to this string on to twistAndPrint, where it will be copied.

    On the other hand, if twistAndPrint accepted an std::string, the compiler could easily figure out that since "input" is no longer used after "twistAndPrint" (the only method that will be called on "input" after twistAndPrint is the destructor), the compiler could create "input" on the stack in a location suitable to the subsequent invocation of twistAndPrint, and no copy operation would be necessary.

    Of course, given sufficient knowledge of what twistAndPrint does and where it is used, the compiler might make the same optimization in the "const std::string&" case. But the point is that this requires the compiler to perform global optimization, using much more knowledge of the entire program, whereas the original optimization requires only local ("peephole") knowledge including the already known signature of twistAndPrint. Therefore, real world compilers will be much more likely to perform the optimization in the pass-by-value case than in the pass-by-reference case. Also, there could be incompatible uses of twistAndPrint which prevent the optimization in the latter case anyhow (most importantly if twistAndPrint is used in a way which prevents the compiler from altering the calling convention without breaking the linked program, i.e. exported to external programs or passed to external programs as a callback).

    For further information, see "Move Constructors" by Andrei Alexandrescu.
  • AdT 2008-05-08 05:42
    Kuba:
    The problem is that incrementing a pointer one past the end of the allocated memory area is an undefined operation per standard (IIRC).


    No, that part is ok. It is fine to point one past the end of an array, as long as you don't dereference, and this is what users of the STL do all the time (remember that pointers are iterators!). The problem is that this code tries to move the pointer one past the beginning of the array, and that is illegal.

    Kuba:
    I don't think there are real scenarios where the code would b0rk, unless you're on some crazy architecture. Maybe some big iron would mind such code. I mean architectures contorted enough to have a dereferenceable (w/o violations) NULL pointers.


    Yes, segmented memory. The array could be at offset 0 in a memory segment. The corresponding pointer is not a NULL pointer, but either the decrement itself or the following comparison will easily cause mayhem.

    Segmented memory may be an oddity on x86 (32 or 64 bit) today because the flat memory model basically won, but no exotic processor architecture is necessary, only a more or less exotic rsp. outdated OS.

    Kuba:
    I think this would still work as you expect, even if the segment registers would be tweaked along the way.


    In real mode, the compiler-generated code may be smart enough to handle this case. But even then, in Borland C++ it would not work in all memory models because only in the "huge" memory model would the compiler bother to insert expensive segment adjustment code for pointer arithmetic in all cases. In other memory models, you had to use a special type of far pointer if you wanted that to happen IIRC.

    In protected mode, segment adjustment isn't even possible in the general case, so all bets are off.
  • AdT 2008-05-08 05:49
    Erik:
    Clearly the woman applying for the clerical position is very detail orented.


    And she has an penchant for using the wrong indefinite article. On the other hand, she does have a pleasant phony voice. :-)

    Russ:
    What if they did C++ on a *nix platform? Not the whole world is MS centric you know.


    Oh, right, I almost forgot that MS invented the STL, and SGI (IRIX anyone?) never implemented that sucker, and never donated the code to the GNU libc++ project, and that libc++ is actually not available on a huge range of UNIX platforms be they Solaris, Linux, Mac OS X or many others. Sheesh.
  • eryn 2008-05-08 06:43
    FredSaw:
    real_aardvark:
    FredSaw:
    OedipusPrime:
    I REALLY hope that even the juniorest guy in the room can tell you the difference between assignment and comparison operators.
    Depends on the language. In VB they are the same.
    *Ahem* No they are not. They happen to be represented by the same symbol (which is idiotic) and are thus lexically the same. Unfortunately, and invisibly, they are syntactically distinct.

    Mind you, this would make for a whole 'nother set of useful interview questions if, for some obscure and twisted reason, you are seeking to hire a VB programmer.
    RA, I respect you more than to say, "What a dumbass reply." So I won't.

    i've lost count the number of times this topic has come up for discussion. wrt the = sign in vb, it's context sensitive.

    hmmm... what's that on ur face? oh it's just egg.
  • John 2008-05-08 07:12
    I'm (almost) certain that the interviewed guy said that as a joke (no code reuse, just likes to start over).
  • Jim 2008-05-08 07:21


    short a[N];

    for (size_t i = 0; i < N; ++i) {

    a[i] = 42;





    As A C novice, I keep wondering why ++i is used instead of i++. Wouldn't that overflow the array at the last iteration, and keep the short with index 0 uninitialized??
  • dpm 2008-05-08 07:30
    Filthy_Liar:

    If sizeof(char)==sizeof(short) then memset will work.
    I don't think that matters,
    memset(a,42,sizeof(short)*N);
    should always work.
    Of course it works. You end up with every element of the array set to 10794, but no errors occur, which I assume is your definition of the word "work".

    memset() assigns a value to every byte in the referenced memory, and your "sizeof short" *looks* like a clue but it's not. The function receives the address of the array, a value, and the number of bytes to fill, period . . . so instead of
    002A002A002A002A002A002A
    the memory will look like
    2A2A2A2A2A2A2A2A2A2A2A2A
  • Khanmots 2008-05-08 07:51
    Jim:
    As A C novice, I keep wondering why ++i is used instead of i++. Wouldn't that overflow the array at the last iteration, and keep the short with index 0 uninitialized??

    for(expr_1; expr_2; expr_3)
    
    {
    statement;
    }


    is equivilent to

    expr_1;
    
    while(expr_2)
    {
    statement;

    expr_3;
    }


    The ++i or i++ is evaluated entirely in expr_3, it doesn't change *when* expr_3 itself is evaluated.

    The difference between ++i and i++ is what value it evaluates to... which in the case of the for loop the value the expression evaluates to is never used.

    Here's an example with behavior analogous to the for loop... notice how the choice of i++ or ++i doesn't matter... j matches i.

    int i = 0;
    
    int j = 0;
    j = i; // j = 0, i = 0
    i++;
    j = i; // j = 1, i = 1
    ++i;
    j = i; // j = 2, i = 2



    Here's an example of when it would matter.

    int i = 0;
    
    int j = 0;
    j = i++; // after this is evaluated j = 0, i = 1
    j = ++i; // after this is evaluated j = 2, i = 2


    And here's another example where it matters.

    int i[N];
    
    int j = 0;
    i[j++]; // this is i[0]
    i[++j]; // this is i[2]


    Hope this helps!
  • snoofle 2008-05-08 08:14
    Jay:
    ..."What is your greatest weakness?"...

    Answer: My greatest weakness is that I have little patience for incompetence... If I have to explain something more than 3-4 times to someone, I tend to insist that they make more of an effort.
  • UpNDown 2008-05-08 08:45
    Jim:


    short a[N];

    for (size_t i = 0; i < N; ++i) {

    a[i] = 42;





    As A C novice, I keep wondering why ++i is used instead of i++. Wouldn't that overflow the array at the last iteration, and keep the short with index 0 uninitialized??


    Not much difference in C, the difference is in C++. The "++object" form is more efficient when dealing with real objects. Using "object++" instead would require that a copy of the object be made before incrementing the real one. The copy is then returned instead of the original. With "++object" a reference to the real one can be returned.

    Not important when you're dealing with ints, or where the value is not being used, but just a good practice to get into, especially with poorly written code that includes dynamic allocations in the object (which you don't want to have to check for). I believe there is a section in Effective C++ about this. The rule is: if you have pointers in your object, you need a destructor, an assignment constructor and a copy constructor (once again, if I remember right).

    This is also an area where different compilers may produce different behaviour -- one may produce a copy of the object, another may not. It's done behind the scenes for you, or *against* you when things go awry. You want to avoid that difference in programs you want to be portable.
  • usitas 2008-05-08 09:03
    The Enterpriser:
    All good coders use vim.. didn't you know?
    Fixed that for ya.

    I used gVIM all the time, even in windows. VIM has had syntax highlighting for years...
  • I walked the dinosaur 2008-05-08 09:29
    Russ:
    Russ:
    diaphanein:
    Russ:
    Ytram:
    ...and get the trick questions wrong, as did most people...


    What's the point of asking a trick question? Is it so you can see how people deal with trick requirements? Or trick designs?


    No so people know how to find bugs in code. For example

    x=3;
    if (x=5)
    cout<<"5";
    else
    cout<<"not 5";

    What is the output?


    5. Next?


    I really hope that was sarcasm


    Actually my bad.. haven't had my morning coffee yet.

    The answer should be 5. It is a bit of a trick question, as some junior developers might not know the difference between

    if (x==5)

    and

    if (x=5)



    By "junior developers", I assume you mean high-school students?

    Seriously though, when I first looked at teh codez above, I didn't see the missing "=" either. Of course I know the difference, but "trick" questions like that are retarded.
  • noName 2008-05-08 09:32
    In this case ++i is the only op being done so its irrelevant.
    However dont do "a[++i] = 42;".
    "a[i++] = 42;" would be OK though... :D
    Search google for «C unary prefix posfix». First hit will get you:

    "The increment/decrement operators can be applied before (prefix) or after (postfix) the operand. The code result++; and ++result; will both end in result being incremented by one. The only difference is that the prefix version (++result) evaluates to the incremented value, whereas the postfix version (result++) evaluates to the original value. If you are just performing a simple increment/decrement, it doesn't really matter which version you choose. But if you use this operator in part of a larger expression, the one that you choose may make a significant difference."
  • noName 2008-05-08 09:36
    If you test candidates for

    x=3;
    if (x=0)
    cout<<"0";
    else
    cout<<"not 0";

    *and* ask for a verbose explanation of the result than you may start getting some pretty explanations: "0 is diferent of 3; therefore «not 0»!"
  • Anon Fred 2008-05-08 09:48
    I must say I love these esoteric discussions of the C spec. Every time I think I know the language someone knocks me down a peg.

    But it's how I learn. Thanks guys.
  • Flavio 2008-05-08 10:31
    K.D. you did not make me laugh. Why don't you just accept that the brilliant guy has never got a project wrong? As surprising as it may be, skilled and smart developers can get things always almost right (or fixed them on the go) and not let a project failed by incompetence.

    I, for one, admire his honesty. He probably knew that what he was going to say could hurt him. I think *he* tested *you*. Something like "Let's if my (potential) boss can cope with a guy like me".
  • Rootbeer 2008-05-08 11:02
    Flavio:
    As surprising as it may be, skilled and smart developers can get things always almost right (or fixed them on the go) and not let a project failed by incompetence.


    "Always almost right". 2+2 = 3.99999, but consistently so.

    He probably knew that what he was going to say could hurt him.


    And he ended up saying something dumb that hurt him. Zero points awarded.

    I think *he* tested *you*. Something like "Let's if my (potential) boss can cope with a guy like me".


    I wouldn't want someone on my team who had to be "coped with". Why can't you play well with others?

  • Edward Royce 2008-05-08 11:16
    The Enterpriser:
    Edward Royce:
    *shrug* personally I'd be wondering why the IDE and/or compiler hadn't picked up on an assignment in an if() statement.


    All good coders use vi.. didn't you know?


    I'd rather use UltraEdit frankly.

    Not a huge fan of vi. Or of emacs.
  • Edward Royce 2008-05-08 11:19
    eryn:
    FredSaw:
    real_aardvark:
    FredSaw:
    OedipusPrime:
    I REALLY hope that even the juniorest guy in the room can tell you the difference between assignment and comparison operators.
    Depends on the language. In VB they are the same.
    *Ahem* No they are not. They happen to be represented by the same symbol (which is idiotic) and are thus lexically the same. Unfortunately, and invisibly, they are syntactically distinct.

    Mind you, this would make for a whole 'nother set of useful interview questions if, for some obscure and twisted reason, you are seeking to hire a VB programmer.
    RA, I respect you more than to say, "What a dumbass reply." So I won't.

    i've lost count the number of times this topic has come up for discussion. wrt the = sign in vb, it's context sensitive.

    hmmm... what's that on ur face? oh it's just egg.


    Hmmmm. Counting coup, nerd-style.
  • An oppressed mass 2008-05-08 11:34
    That's why an experienced programmer will always write.
    if ( 5==x ) {
    }
    We had this arguement on here before:
    "An expert programmer shouldn't rely on the compiler to find his mistakes" vs "An expert programmer uses all the help he can get"

  • K.D. 2008-05-08 12:09
    (I'm the original poster/interviewer in the story)

    Yes, that in fact, I believe, was what he meant. He didn't believe in ever going back to refer to previous work (of his or anyone else's) but rather wanted to start every single project with a clean slate. Admirable in a sense, but why on earth would you want to re-invent simple common elements over and over?

    And to the person who said that asking someone to point out their weaknesses is a flawed interview style -- well, actually, it's worked very well for me. This candidate was horrible flawed, and by opening a door, he pointed it out himself.
  • CB 2008-05-08 12:14
    dpm:
    snoofle:
    morry:
    I'd like to come up with some trick questions to ask a company in an interview some time.

    For any established organization: {...}

    That's a good list, but the one I always ask is "what do you use for source code control?"

    There are some good answers and some poor ones, depending on the scale of the projects involved. But the two that always raise red flags are "none" and "we use a system we developed in-house". Danger Will Programmer!


    Heh, the job I am about to leave gave the latter as an answer when I asked. Actually, they volunteered it as if it were a source of pride. Gah.

    Bonus points if said in-house "source control" is written in VB6.
  • Justin 2008-05-08 14:30
    I was about to say the same thing. To the best of my knowledge, most university classes do not discuss namespaces. I feel like many C++ programmers just know that they need to put using namespace std; at the top of their files.

    Additionally, I have to wonder how important it is that a job candidate understand namespaces on the day that they start if they show overall competence. First, namespaces are easy to understand, so, it wouldn't take long to explain to explain if your organization really is making use of them. Second, I think that maybe half of all organizations actually take care to use them in any meaningful way.
  • Pecos Bill 2008-05-08 15:35
    Some Interviewer:


    1. Sometimes you need a warm body; this is where the best of the worst is still better than nothing. (Sadly.)
    At least there's one valid reason.

    2. Legal reasons. If a candidate is immediately turned down, they may assume it was because of their gender, race, religion, etc. and not because they failed a test.

    Fields that involve physical activity (electrician, plumber, etc.) failure is pretty obvious to spot. The light doesn't turn on, the faucet leaks all over, etc. Fields like software development aren't quite so easy. The candidate didn't even understand the test; how will they comprehend their failure?
    Because you could tell them that they failed and if they ask why, you could say you don't have time to teach them. If you did tell them, you aren't opening up a legal battle if you are right. The HIGH cost of legal battles will keep most from even attempting. People have been graded since early childhood and are going to accept it (if mentally sound and if not then you might have a valid reason.) If you ARE rejecting based on personal attributes, "not a good fit" is used a lot or you could cop out but that wasn't WhiskeyJack's point.

    3. It's how the game is played. Don't whine.
    Great argument for status quo lovers. I hope people that pick #3 get LOTS of annoying calls asking.
  • chaoticsynergy 2008-05-08 16:07
    Flavio:
    K.D. you did not make me laugh. Why don't you just accept that the brilliant guy has never got a project wrong? As surprising as it may be, skilled and smart developers can get things always almost right (or fixed them on the go) and not let a project failed by incompetence.

    I, for one, admire his honesty. He probably knew that what he was going to say could hurt him. I think *he* tested *you*. Something like "Let's if my (potential) boss can cope with a guy like me".


    Honestly I'm shocked at the number of pple that posted stuff similar to this. Nobody has ever put out 100% perfect work. If you can't accept your own faults, then you'll never improve.

    Yes your projects may all have been completed successfully ... that doesn't mean there weren't decisions you made that you had to go back and change, or in hind-sight wished you could have changed.

    I hope I get asked that question at future interviews. Then at least I'll know that I'll be working with people that grow ... instead of stagnate in the knowledge that everything they produce is perfect.
  • Anonymous Coward 2008-05-08 16:56
    Anon Fred:
    I must say I love these esoteric discussions of the C spec. Every time I think I know the language someone knocks me down a peg.

    But it's how I learn. Thanks guys.


    Yes, I agree. This is the perfect kind of question I want my company to be asking in an interview.

    Why worry about actual coding ability when they can rattle off obscure facts about the C language specification that are rarely applicable to modern architectures? After all, as we all know, everyone who is worth their salt has been coding in C since the days of segmented memory.

    Furthermore, I think it goes without saying that people who enjoy picking apart trick questions are the very kind of people I want designing my algorithms. Sure, its one thing if the algorithm *works*, but is it *optimized*? No doubt we would all agree that all algorithms we write should exhibit the same kind of cleverness as these questions. Cleverness = maintainability.

    To extend this idea a bit, I think I will ask interview questions about real-mode programming and maybe pepper in a few questions about the ALGOL specification.
  • real_aardvark 2008-05-08 18:27
    alegr:
    "Oh, that..." she said, "I didn't know what this 'std' means."

    That's what you get for unsafe hex!
    OK, that was just very silly. And very funny. Thanks.
  • Procedural 2008-05-09 00:04

    I was in Jonestown, Tanzania once and saw a strip mall shop sign announcing Kinko-like services and more. The shop was also offering typing services. The name, written in bold letters in front of the shop, was "Helen's Secretalrial Services".

    I didln't enquire about their serlvices.
  • Manic Mailman 2008-05-09 15:25
    Anonymous Coward:
    Anon Fred:
    I must say I love these esoteric discussions of the C spec. Every time I think I know the language someone knocks me down a peg.

    But it's how I learn. Thanks guys.


    Yes, I agree. This is the perfect kind of question I want my company to be asking in an interview.

    Why worry about actual coding ability when they can rattle off obscure facts about the C language specification...


    I actually agree with you that posing trick questions about obscure trivia is not a great interview technique, but it can be a good learning technique. If you're not interested in understanding or learning why something like underflow on pointer arithmetic might result in undefined behavior, then you might want to stay away from C/C++ because those languages love to stick you with runtime bugs that result in rare instances of that undefined behavior biting you in the ass. Without a doubt, this is a major drawback of C/C++; other languages let you largely stop worring about such details.

    So, while maybe being able to pick out the obscure potential bug is not something to look for in a potential hire, I'd certainly like anyone who I'm working with on a C/C++ project to at least *want* to understand or learn about these pitfalls if someone's pointing them out.
  • C++ dev 2008-05-11 02:58
    Yes, I agree. It makes me wonder if the author understands the language very well himself. There certainly are cases where a mutable value parameter is preferable.

    At companies in the Seattle where I have interviewed - and worked - at (Amazon, Microsoft, Real) there is much more of an emphasis placed on higher level design than on basic language semantics. When I have interviewed for our team I always focus on finding out what the candidate can do well and how they would be able to contribute. Often intellectual horsepower is a better measure of a candidate than language specifics anyway.
  • Random832 2008-05-12 11:21
    brazzy:
    David Schwartz:
    Highly-experienced C++ programmers might have little to no familiarity with the standard library functions. This is especially true for people who have been programming C++ for a very long time and maintain codebases that still have to run on machines whose standard library support is somewhat lacking.

    Not being familiar with details of the standard library is excusable, but not even knowing what it is is not.


    There is a difference between not knowing what a standard library is, and not knowing what its namespace is, or that it has one, since some implementations let you call the entire standard library (or what parts of it are implemented) without it.
  • Random832 2008-05-12 11:30
    WhiskeyJack:
    Some Interviewer:
    1. Sometimes you need a warm body; this is where the best of the worst is still better than nothing. (Sadly.)

    2. Legal reasons. If a candidate is immediately turned down, they may assume it was because of their gender, race, religion, etc. and not because they failed a test.

    Fields that involve physical activity (electrician, plumber, etc.) failure is pretty obvious to spot. The light doesn't turn on, the faucet leaks all over, etc. Fields like software development aren't quite so easy. The candidate didn't even understand the test; how will they comprehend their failure?

    3. It's how the game is played. Don't whine.


    Hey, I ain't whining - I got my job already. Every place that had me for an interview gave me an offer. I'm just thinking that it would be so much more practical (albeit less funny stories for sites like this) if people who are obviously unqualified, or have extreme quirks, to be told so. Might actually be an incentive for them to improve.

    Like the guy in the first story, the interviewer was ready to hire him until he said his last bit. It would be nice if the interviewer could have actually told him "I was ready to hire you until you said that last part. That's not how it's done in the industry, so, sorry..." The intent is to have these people walk out of the room thinking "Have I got it wrong? Do I need to change my way of thinking?" rather than "Bah, another jerk company that won't recognize me for the programming God that I am!"

    Granted you'll always have a few that think that way and nothing will change them, but for the rest, finding out WHY you didn't get the job should be a good teaching experience.


    The policy "Can't tell them why they're not hired for legal reasons" has always translated in my mind to "Some of our reasons for not hiring people are illegal".
  • Random832 2008-05-12 11:42
    Kuba:
    If sizeof(char)==sizeof(short)


    This is never true on a normal programming environment (it may be true for some exotic embedded systems) - the reason: sizeof(char) always == 1. sizeof(short) is ALMOST NEVER going to be that, because a short has to be at least 16 bits, and a char is _normally_ eight bits.
  • real_aardvark 2008-05-12 13:08
    snoofle:
    Jay:
    ..."What is your greatest weakness?"...

    Answer: My greatest weakness is that I have little patience for incompetence... If I have to explain something more than 3-4 times to someone, I tend to insist that they make more of an effort.
    I'm sorry, I wasn't really paying attention. What did you say your greatest weakness was, again?
  • felix 2008-05-15 07:20
    Fresh out of uni my CV was short on content so I decided to employ a "professional" CV writer to rewrite it for me using all the tricks of the trade. I filled in her questionnaire and sent off the results, a couple of weeks later I received the finished article. There were _numerous_ typos including the following:

    "Accurate and eloquent in witten communications."
  • Anonymous Coward 2008-05-16 08:37
    FredSaw:
    Velko:
    Never make any mistaeks.
    -- Anonymous, in a mail discussion about to a kernel bug report.
    Wow, what a dumbass! Can you spell "looser"?
    -- Not anonymous, in the middle of a forum confrontation, but I will keep him so anyay, bless his uneducated little heart.


    Anyay?
  • IByte 2008-06-28 08:33
    Mrs. Applicant:
    I didn't know what this 'std' means.
    It's what you get when you're screwed, and you certainly are...
  • caught ya 2008-09-22 19:29
    This is obviously engineered (poorly).
  • 111 2008-11-10 07:26
    情趣用品情趣用品情趣用品情趣用品情趣情趣情趣
    情趣按摩棒跳蛋充氣娃娃
    情境坊歡愉用品[/url[url=http://www.show688.net/shop/index.php?wid=twjason]情趣用品情人節禮物情惑用品性易構免費A片AV女優美女視訊情色交友免費AV色情網站辣妹視訊美女交友色情影片成人影片成人網站A片H漫18成人成人圖片成人漫畫情色網日本A片免費A片下載性愛成人交友嘟嘟成人網成人電影成人成人貼圖成人小說成人文章成人圖片區免費成人影片成人遊戲微風成人愛情公寓情色情色貼圖情色文學做愛色情聊天室色情小說一葉情貼圖片區情色小說色情寄情築園小遊戲色情遊戲情色視訊情色電影AIO交友愛情館言情小說愛情小說色情A片情色論壇色情影片視訊聊天室免費視訊聊天免費視訊視訊美女視訊交友視訊聊天免費視訊聊天室AIOA片下載AV[url=http://www.ing.net/042]AV片A漫AV DVDAV成人網聊天室成人論壇本土自拍自拍A片


  • sfsad 2009-01-21 23:50
  • huojia 2009-03-01 23:32
    &nbsp;&nbsp;
    货架racking.&nbsp;&nbsp; 仓储货架
    南京货架设备要产品包括:重型货架
    ,阁楼货架,超市Shelf,重量型货架,横梁式货架,驶入式货架... 仓储笼
    货架的形式与材料 · 立体仓库 · 货架厂
    物流规划设计的步骤与程序(货架的设计... 中国物流行业呈现三足鼎立抢市场 · 亚洲第三方物流的现状和发展 ... 托盘
    抽出式货架系列 · 重力式 货架/推入式货架钢托盘
    移动式货架 · 阁楼式货架 · 悬臂式货架
    系列 长件物料储存货架&nbsp;货架公司
  • wm 2009-07-06 05:25
  • Baloney Bear 2010-03-06 23:22
    Oh, please, who can remember what all those acronyms mean? The question is, does she know how to -use- std? (What does it mean, anyway? Standard? And whenever I see stdio and want to pronounce it as "studio"... Talk about poor naming conventions...)
  • lifekills 2014-08-15 09:50
    Team player with independently abilities


    That's more WTF than what was highlighted although less hilarious