- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
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.
Admin
Admin
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.
Admin
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.
Admin
A compiler error, I hope.
Admin
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."
Admin
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.
Admin
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.
This code, besides being literally backwards, looks normal, right? Right?
Admin
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.
Admin
I believe "FORTRAN" is the word you are looking for there ;-).
Admin
Brillant!
Admin
At the last loop p will run outside the "a" momory-section and will cause Memory Access error...
Admin
[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.
Admin
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!
Admin
No, because we don't dereference it.
Admin
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.
Admin
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.
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).
here's one way to init the array that I believe is correct
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?
Admin
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.
Admin
Don't interviews of that nature consist solely of negotiating a "rate"?
Admin
Perhaps he was one of the contractors who first answered the Call of Codethulu...
Admin
Admin
I think you're right... it's been a while since I've done C but I believe you'd have to say:
Again, it's been a while so I could be wrong.
Admin
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).
Admin
Damn, I didn't expect this one to be solved so quickly. 8=]
Bingo.
You mean sizeof(short *).
Agreed. And there is a real-world example. Hint: the system I'm talking about was widespread about, say, 15 years ago.
Yeah, that's obviously correct; but for C++ I was hoping for a more standard library-esque solution. ;-)
Uhm, yeah, sure! As soon as I start my own company, that is.
Admin
Actually integer positive means that the value is >0.
Admin
Which is basically where the rest of us live.
Admin
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.
Admin
FAIL!
Admin
To be fair, the bullet point stated "wit minor errors." Instaed of "wit zero errors."
Admin
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.
Admin
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?
Admin
Good ol' x86 segmented memory. That was exciting to program for.
Admin
Admin
"Exclusive Research Skill with Details"? Is that like "Friends with Benefits" or a "Massage with Happy Ending"?
Admin
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):
which will of course output "5" as expected. Sheesh. Doesn't anyone teach the preprocessor anymore? :-P
Admin
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.
Admin
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:
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 ;-)
Admin
"Oh, that..." she said, "I didn't know what this 'std' means."
That's what you get for unsafe hex!
Admin
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)
Admin
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
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.
Admin
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!
Admin
juniorest n. Someone who more juniorer than the most juniorized of juniors.
Admin
"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?
Admin
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 :)
Admin
Listen, I'm just an ignorant, unattractive ColdFusion developer and I could probably learn the STL given a week or two.
Admin
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.
Admin
shrug personally I'd be wondering why the IDE and/or compiler hadn't picked up on an assignment in an if() statement.
Admin
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!
Admin
Hmmmm.
The question I like to ask:
What is the source code repository used on the project.
What is the bug tracking software.
...
I'm amazed at how many times the answer is, in order, "none" and "Excel".
Admin
All good coders use vi.. didn't you know?