nickcv said:the first dude just got out of the building... i'm speechless about what he wrote for the fizzbuzz test...
nickcv said:as you wish!
Code:Lolz code
i just copied it as it is
ronito said:I find it funny that developers outside of doctors are pretty much the only profession where it's pretty much expected you'll end up having to sleep in the office or work insane hours. You don't see accounting do that. Let alone sales and marketing.
nickcv said:tomorrow i'll be interviewing a couple of people to fill a programmer position in my company.
Do you guys know any tricky question i could ask? (besides the fizzbuzz test i mean)
an evil suggestion is much appreciated![]()
Evil Java question said:Fill in the blank so that this method returns false...
Code:public boolean shouldReturnFalse() { // declare local variables x and y here y = x; return x == y; }
for (int i = 1; i <= 100; i++) {
if (i % 15 == 0) {
System.out.println("Fizzbuzz");
} else if (i % 5 == 0) {
System.out.println("Buzz");
} else if (i % 3 == 0) {
System.out.println("Fizz");
} else {
System.out.println(i);
}
}
iapetus said:You forgot to mention what language(s) you're interviewing for, what frameworks they'll be using, the level of the people you're interviewing (recently graduated, experienced devs etc.)
Really, you don't need complex evil suggestions. Mostly those rely on language quirks. It's all very well to throw something like:
But really, who needs to know that?
Instead, give them a simple task to implement. Fizzbuzz is fine. Implementing equals() in Java is fine. If they don't know what they're supposed to be doing, tell them the spec.
Then make them justify their implementation. Tell them it's not efficient enough. Add extra constraints on it.
For example, most people will use % (or the equivalent in the local currency) to implement Fizzbuzz.
Code:for (int i = 1; i <= 100; i++) { if (i % 15 == 0) { System.out.println("Fizzbuzz"); } else if (i % 5 == 0) { System.out.println("Buzz"); } else if (i % 3 == 0) { System.out.println("Fizz"); } else { System.out.println(i); } }
Tell them the three % checks are too inefficient for your high-speed Fizzbuzz app on low-powered devices, and that they have to implement it more efficiently.
Ask them how they'd extend it to handle a configurable set of multipliers so that it's easily extensible if you wanted to add multiples of 7 getting a Boom.
If they make it through coding, get them to answer questions that show some insight into the process of development and the languages they work with.
"Should code be thoroughly commented, or is all good code self-documenting?"
"In a 40-lesson course on Java, in which lesson should object orientation be introduced?"
"What's the worst feature of C++?"
"You list Ruby, Perl, Java and C on your CV as languages you have experience with. Which is the best language out of the four and why?"
"Why do software products become bloated? At what point is a complete rewrite necessary?"
"When should you use an existing web framework for UIs, and when should you roll your own?"
Don't accept their answer. Challenge it, whether you agree with it or not. Make them work to justify it. Nobody should come out of a good interview feeling like it was a test of a few things they either knew or didn't know and they passed because they knew them. They should come out sweating, panicking, and worrying that they don't know enough to get a job anywhere.
nickcv said:gonna try that!
I'll have the next interview in an hour and a half.
anyway i'm interviewing to fill a php/java senior position.
Zoe said:I've always thought this question was interesting:
"What's the difference between i++ and ++i?"
It's pretty trivial, but I've found that the people who can't answer that are the ones who are mostly self-taught.
See, I think stuff like this is just masturbatory. Either you are hiring fresh grads, in which case they may just scratch their head, or you are interviewing for a more experience position, in which case they will think you're a tool.iapetus said:A follow-up question:
"Why is 'C++' a bad name for the language?"
poweld said:See, I think stuff like this is just masturbatory. Either you are hiring fresh grads, in which case they may just scratch their head, or you are interviewing for a more experience position, in which case they will think you're a tool.
I judge the interviewer partially by the questions they ask me. If they are wasting my time with easy or punny questions (like that one) I lose some respect for them.
Yes, I know, it returns C.
iapetus said:Well duh. Not suggesting it as a serious interview question - just a jokey question in a thread which seems to have the appropriate audience for it. Next you'll be telling me that strings can't really walk into a bar...
Two strings walk into a bar. The first says "Can I have a pint of beer and a packet of pork scratchings please?HIOPhg hregoua809y 89 a890w3ty y hpa9p 2 atr3h hfw98aphH AZHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH".
The second says to the barman, "Sorry, you'll have to excuse my friend. He's not null-terminated."
Fair enoughiapetus said:Well duh. Not suggesting it as a serious interview question - just a jokey question in a thread which seems to have the appropriate audience for it. Next you'll be telling me that strings can't really walk into a bar...
Two strings walk into a bar. The first says "Can I have a pint of beer and a packet of pork scratchings please?HIOPhg hregoua809y 89 a890w3ty y hpa9p 2 atr3h hfw98aphH AZHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH".
The second says to the barman, "Sorry, you'll have to excuse my friend. He's not null-terminated."
poweld said:Fair enough
Just wanted to make clear to that soon-to-be-interviewer to make good decisions and not embarrass himself.
iapetus said:Nobody should come out of a good interview feeling like it was a test of a few things they either knew or didn't know and they passed because they knew them. They should come out sweating, panicking, and worrying that they don't know enough to get a job anywhere.
this. ffs i am just a student, i haven't learned about the fizz buzz test. will ask prof on IRC later.mantidor said:You people would destroy me in an interview.
The first thing that comes to my mind for a tricky, very specific question is "can I look it up on the internet?" because that is what I do whenever I got stuck, or don't know. There are some things you have to know without looking, I agree, but is not obscure, tricky things you rarely use in your work. In this time and age I really find memorizing to be useless and a waste of effort, everything is right there, and people even answer your specific question in forums.
I think I would do well with change in requirements, argumenting answers and the like, that's what I had to learn the hard way in my job experience, dealing personally with the costumers.
nickcv said:as you wish!
Code:for (i = 0; i < 100; i++) { if (i/3 = int) { print "fizz"; } if (i/5 = int) { print "buzz"; } else { print i; } }
i just copied it as it is
edit:
i forgot, it's supposed to be php.
Kalnos said:It seems more like he was writing pseudo-code, and going by that, I can at least see what he was doing logically. I know, I know, there are thousands of better ways to do this, including very easily with modulus, but I don't think that his answer is hysterical or anything.
It is worse if he was interviewing for a senior position, though.
nickcv said:ok, this is getting ridiculous
at first i was like "i see nothing wrong" but then i lold. yea she was stressed. you people don't realize how intimidating you can be.nickcv said:ok, this is getting ridiculous
Code:foreach ($i <= 1; $>=100; ++$) { if ($i %3) print 'fizz'; else if ($i % 5) echo 'buzz'; else if ($i % 5 && $i % 3) echo 'fizzbuzz'; }
but i think she was panicking.
problem is we cannot afford a programmer with stress-coping issues
Zoe said:It is wrong though. Even if we give him the benefit of the doubt, with that solution it will always print out the number unless it's a multiple of 5.
Speaking of pseudo-code though... I'm already nervous enough at interviews. I'm not sure I can write 100% syntactically correct code on demand like that.
nickcv said:ok, this is getting ridiculous
Code:foreach ($i <= 1; $>=100; ++$) { if ($i %3) print 'fizz'; else if ($i % 5) echo 'buzz'; else if ($i % 5 && $i % 3) echo 'fizzbuzz'; }
but i think she was panicking.
problem is we cannot afford a programmer with stress-coping issues
mantidor said:You people would destroy me in an interview.
The first thing that comes to my mind for a tricky, very specific question is "can I look it up on the internet?" because that is what I do whenever I got stuck, or don't know.
mantidor said:I don't know if interviewers should follow this literally for every single interview, you are interviewing because you are looking for someone to do a job, the interview should be focused on the specifics of that job, not in panicking a future employee. That doesn't mean the interview shouldn't be demanding and relenteless if the position requires it, but not all positions are like that.
nickcv said:ok, this is getting ridiculous
but i think she was panicking.
problem is we cannot afford a programmer with stress-coping issues
iapetus said:It's all about making sure that the candidate can argue for their answers and justify them. That's a fundamental skill necessary for most coding work, IMO.
iapetus said:The best interviews I've attended have all been like that, but then I guess that's the sort of candidates they've been looking for. It's all about making sure that the candidate can argue for their answers and justify them. That's a fundamental skill necessary for most coding work, IMO.
mantidor said:I really agree, it just felt to me that making an interviewee think he can't get a job anywhere is just unnecessary cruel hehe
Zoe said:I've always thought this question was interesting:
"What's the difference between i++ and ++i?"
It's pretty trivial, but I've found that the people who can't answer that are the ones who are mostly self-taught.
ronito said:This recent thread turn has reminded me why I HATE programmer interviews.
Almost all of them turn into a ecock measuring exercise.
Ha! I can do Fizzbuzz in 3 lines, can you? Just look at how my ecock throbs!
Now I'm not saying that interviews should be push overs. I'll admit that I've made people cry in mine and had a few storm out/hang up. But I hate it when someone pulls out some old "Gotcha!" exercise, especially when people assume that just because you're a programmer you must be good at puzzles. Some of the best programmers I've worked with couldn't solve a puzzle on the spot for their life. Now again, it's not supposed to be easy, I'll intentionally ask a question I know the interviewee doesn't know the answer to in order to see how they deal with that. But sometimes I just feel like it's all about the ecock.
jman2050 said:I'm completely self-taught and I know the answer to that question!
:x
I've never really had the opportunity to interview for a programming job so I can't say anything for sure, but just logically thinking about it, while it's counterproductive to be all clever and cutesy with a prospective employee, you still have to ensure that they know what they're doing. And I don't think people like iapetus are necessarily talking about just answering a bunch of questions correctly/incorrectly, but more talking about a person's ability to logically work their way through a problem. That's the real core of programming after all, developing and maintaining systems that are meant to perform logical tasks or provide functionality for users to do the same. Being able to understand a system's structure and make it work efficiently is a skill all programmers need to develop to some degree, and the interview should be designed to draw out those traits.
The Fizzbuzz test is a simple example of this, as in that case it doesn't seem to be about the language used or the syntax or how neat the code is, etc, but it's about the interviewee being given a specific task to perform and having to think "how could I describe this problem in a logical fashion?" "What variables do I need to take into account?" "What's the most efficient way to solve thw problem?" "What tools that I know of are best suited to solve this problem?" Regarding that last question, some people will make the obvious logical connection, "'divisibility' means use modulo", while some may not make the connection but come up with a more creative solution. The thought process used to arrive at their solution is just as important as whether the solution was correct.
class Monster {
String name;
double defense;
// input: 0.0 <= _defense <= 1.0
public Monster(String _name, double _defense) {
name = _name;
defense = _defense;
}
public boolean didDefend() {
// @TODO: get a random number and see if it successfully defended
// output: a random true or false value.
// if defense == 0.0, this function should always return false.
// if defense == 1.0, this function should always return true.
// if defense is between 0.0 and 1.0, it should return randomly,
// with a distribution determined by the Monster's defense stat:
// e.g. if this is called repeatedly on a Monster with defense = 0.2,
// it should return true approximately one time out of five.
// reminder: java.util.Math.random() returns a double between 0.0 and 1.0 inclusive.
}
}
public boolean didDefend() {
return java.util.math.Random() < defense;
}
The_Technomancer said:Alright, so the basic three modulus check version of Fizzbuzz looks perfectly straightforward. How would you optimize it to less code?
x = Scanner.nextInt();
i = 2;
j = 2;
while (i < x)
{
while (j < x)
{
if (i*j = x)
{
System.out.printf("%d, %d",i,j);
}
j = j + 1;
}
i = i + 1;
}
nickcv said:i just finished speaking about the last guy of the day (tomorrow i'll have two more)
and i really didn't like his attitude.
he clearly knows what he is doing but he did some rookie mistakes.
- he talked trash about his last boss.
- he started fizzbuzz test but then didn't want to complete it saying "you can fill the rest of it"
he was doing it right, but i don't think i want to work with someone so arrogant.
yeah no mistaking the "J" in there.Not A Fur said:Whoa.
Are you sure he didn't say 'screwed'?
Because..
whoa.
It's a slur when you get screwed out of something. Someone will say "They totally jewed me out of it." I had heard it before on the street but hearing someone say that in an interview was just shocking.nickcv said:i don't get it o.o
i know what jews are but i don't know what that means.
Weirdest thing was I had to fire two Indians because the dev lead was also from India but I guess from a lower caste, and the two wouldn't do what the dev lead told them. I too thought because of the whole "melting pot" thing I never thought I'd deal with that. But I was wrong.nickcv said:oh i get it, so he was being racist.
i thought you guys overthere dealt better with this kinda things with all the different ethnic groups you have o.o
ronito said:Weirdest thing was I had to fire two Indians because the dev lead was also from India but I guess from a lower caste, and the two wouldn't do what the dev lead told them. I too thought because of the whole "melting pot" thing I never thought I'd deal with that. But I was wrong.