nickcv
Member
(04-05-2011, 10:55 AM)

nickcv's Avatar
#201

the first dude just got out of the building... i'm speechless about what he wrote for the fizzbuzz test...
Zoe
(04-05-2011, 10:57 AM)

Zoe's Avatar
#202

Originally Posted by nickcv:
the first dude just got out of the building... i'm speechless about what he wrote for the fizzbuzz test...
Please share :lol
nickcv
Member
(04-05-2011, 11:06 AM)

nickcv's Avatar
#203

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.
Last edited by nickcv; 04-05-2011 at 11:10 AM.
dabig2
Member
(04-05-2011, 11:12 AM)

dabig2's Avatar
#204

Originally Posted by nickcv:
as you wish!

Code:
Lolz code
i just copied it as it is
Hahaahahahahahaha!
Haly
One day I realized that sadness is just another word for not enough coffee.
(04-05-2011, 11:15 AM)

Haly's Avatar
#205

Wat wat.
industrian
will gently cradle you as time slowly ticks away.
(04-05-2011, 11:15 AM)

industrian's Avatar
#206

Originally Posted by ronito:
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.
During a new product launch, I once worked 9am-10pm for two weeks. It was absolute hell considering I normally roll out before 7pm.

We've got our biggest product release in two weeks. It's going to be a lot of fun.
iapetus
Scary Euro Man
(04-05-2011, 11:17 AM)

iapetus's Avatar
#207

Originally Posted by nickcv:
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 :P
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:

Originally Posted by Evil Java question:
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;
}
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're going to have design responsibilities, hit them with a spec for a data format and ask them to sketch out a rough design for a program that would read and write that data format. PNG is a good one, or a subset of HTTP requests. Once they've done that, ask them how they'd handle various extensions to it.

If they make it through coding and design, 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?"

"In what situations do Extreme Programming techniques work well, and in what situations do they fail?"

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.
Last edited by iapetus; 04-05-2011 at 11:21 AM.
nickcv
Member
(04-05-2011, 11:21 AM)

nickcv's Avatar
#208

Originally Posted by iapetus:
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.
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
(04-05-2011, 11:29 AM)

Zoe's Avatar
#209

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.
iapetus
Scary Euro Man
(04-05-2011, 11:30 AM)

iapetus's Avatar
#210

Originally Posted by nickcv:
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.
Make them sweat. :P

And I've made a few additions to my post since you quoted it.

equals() is a good one for Java, because although it's an incredibly fundamental method which you may need to implement in a lot of cases (depending on the sort of coding you're doing) most people just don't get it right. Common mistakes:

1. Using instanceof to check whether the other object is of the same type. Or not checking that they're the same type at all.
2. Not implementing hashCode(). If you override equals() you *must* override hashCode().
3. Not checking for null values.

And there's almost *always* a better implementation of at least one part of what they write.
iapetus
Scary Euro Man
(04-05-2011, 11:31 AM)

iapetus's Avatar
#211

Originally Posted by Zoe:
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.
A follow-up question:

"Why is 'C++' a bad name for the language?"
poweld
Member
(04-05-2011, 11:35 AM)

poweld's Avatar
#212

Originally Posted by iapetus:
A follow-up question:

"Why is 'C++' a bad name for the language?"
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
Scary Euro Man
(04-05-2011, 11:43 AM)

iapetus's Avatar
#213

Originally Posted by poweld:
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.
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."
nickcv
Member
(04-05-2011, 11:47 AM)

nickcv's Avatar
#214

Originally Posted by iapetus:
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."

i actually lol'd XD
poweld
Member
(04-05-2011, 12:07 PM)

poweld's Avatar
#215

Originally Posted by iapetus:
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 enough :)

Just wanted to make clear to that soon-to-be-interviewer to make good decisions and not embarrass himself.
nickcv
Member
(04-05-2011, 12:08 PM)

nickcv's Avatar
#216

Originally Posted by poweld:
Fair enough :)

Just wanted to make clear to that soon-to-be-interviewer to make good decisions and not embarrass himself.
i'll do my best poweld, don't worry!
poweld
Member
(04-05-2011, 12:17 PM)

poweld's Avatar
#217

Maybe I'm being too literal this morning. I think I'm frustrated from not being able to solve a problem at work.

Also, I'm still a little raw from finding many classes inheriting from STL containers in our code. Noooooo why couldn't you just have a container within your class? Don't be so goddamn lazy!
mantidor
Member
(04-05-2011, 02:57 PM)

mantidor's Avatar
#218

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.

Originally Posted by iapetus:
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.
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.
Last edited by mantidor; 04-05-2011 at 03:12 PM.
Complex Shadow
Cudi Lame™
(04-05-2011, 03:04 PM)

Complex Shadow's Avatar
#219

Originally Posted by mantidor:
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.
this. ffs i am just a student, i haven't learned about the fizz buzz test. will ask prof on IRC later.
Kalnos
Banned
(04-05-2011, 03:14 PM)

Kalnos's Avatar
#220

Originally Posted by nickcv:
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.
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
Member
(04-05-2011, 03:15 PM)

nickcv's Avatar
#221

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
(04-05-2011, 03:17 PM)

Zoe's Avatar
#222

Originally Posted by Kalnos:
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.
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.

Originally Posted by nickcv:
ok, this is getting ridiculous
She was trying to be clever here, but I think she forgot that mod returns 0 when it's a divisor.
Complex Shadow
Cudi Lame™
(04-05-2011, 03:21 PM)

Complex Shadow's Avatar
#223

Originally Posted by nickcv:
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
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.
Kalnos
Banned
(04-05-2011, 03:22 PM)

Kalnos's Avatar
#224

Originally Posted by Zoe:
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.
I know, I'm just saying that you can see his thought process, and that he might actually know what he's talking about and that he just may be nervous or the like. I can't say for sure because I'm not interviewing him, but his answer is hardly something to ridicule.

With that said, at the interviews I have been to they haven't grilled anyone for syntax as far as I know. It's usually more to see if you grasp basic programming terminology/ability and are able to display that by solving a simple problem. Still, if you are worried about it, that's something that you just have to ask during the interview before answering their question.
mantidor
Member
(04-05-2011, 03:23 PM)

mantidor's Avatar
#225

Originally Posted by nickcv:
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
assesing stress tolerance is really hard from what little I know, I have coworkers who did excellent on these tests but do not handle pressure that well, and the opposite is also true. From what my boss and some coworkers who do interviews say, the best way is the one on one interview, and experience in reading people.
iapetus
Scary Euro Man
(04-05-2011, 03:24 PM)

iapetus's Avatar
#226

Originally Posted by mantidor:
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.
That's why I don't like interview questions that rely on rote knowledge of APIs, and wouldn't mark anyone down for not knowing those APIs (yes, I know some of the equals() implementation task can rely on that, but I'm always happy to provide the necessary specs).

Originally Posted by mantidor:
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.
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.
iapetus
Scary Euro Man
(04-05-2011, 03:27 PM)

iapetus's Avatar
#227

Originally Posted by nickcv:
ok, this is getting ridiculous

but i think she was panicking.
problem is we cannot afford a programmer with stress-coping issues
Always give them multiple chances to address their problems.

With that listing, I'd go with:

"Can you see anything wrong with your implementation?"

"Can you walk me through how this would work for the first few numbers?"

And so on. At some point they catch on, and either fix things or panic. :)
Kalnos
Banned
(04-05-2011, 03:29 PM)

Kalnos's Avatar
#228

Originally Posted by iapetus:
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.
This is true to the core. My boss makes me do this all the time, it isn't something that ends with interviews.
survivor
Member
(04-05-2011, 03:31 PM)

survivor's Avatar
#229

Some of these interview questions really look impossible to me. I really hope by the time I graduate I can answer most of them. When I was interviewing for my co-op job, I was panicking just answering questions like what's the difference between inheritance or interface or what's the difference between == and equals()
mantidor
Member
(04-05-2011, 03:41 PM)

mantidor's Avatar
#230

Originally Posted by iapetus:
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.
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
iapetus
Scary Euro Man
(04-05-2011, 03:58 PM)

iapetus's Avatar
#231

Originally Posted by mantidor:
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
They get over it. Last person who had a really hard time with one of my interviews went on to get a graduate job at IBM. :P They've got more time to bring someone up to speed than we did at the time, of course, and I like to think he did better at their interview as a result of ours. :)
ronito
got my tag in the OT
(04-05-2011, 04:09 PM)

ronito's Avatar
#232

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
Member
(04-05-2011, 04:32 PM)

jman2050's Avatar
#233

Originally Posted by Zoe:
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.
I'm completely self-taught and I know the answer to that question!

:x

Originally Posted by ronito:
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.
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.
Last edited by jman2050; 04-05-2011 at 04:40 PM.
Wormdundee
Member
(04-05-2011, 04:44 PM)

Wormdundee's Avatar
#234

Originally Posted by jman2050:
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.
I do know what he's talking about though. I've actually only had 2 jobs so I'm not super experienced with interviews but both of those interviews were well done I thought. They asked questions that evaluated what I knew although they are certainly easier interviews because they were for low-level positions.

I read those questions that are supposedly from google interviews and they are just nonsense abstract questions.
The Technomancer
card-carrying scientician
(04-05-2011, 05:06 PM)

The Technomancer's Avatar
#235

Alright, so the basic three modulus check version of Fizzbuzz that iapetus posted looks perfectly straightforward. How would you optimize it to less code?
dope4goldrope
Member
(04-05-2011, 05:08 PM)

dope4goldrope's Avatar
#236

A friend of mine said they knew someone who needed some work so I didn't follow through with any of the usual precautions and thought to myself "Hey, it's a friend of a friend! What's the worst that can happen?"

Yeah, well, even after seeing a functional prototype the client was determined that I should finance the project to completion and only when I delivered that they would they pay me. Then didn't go so well with me, so my middle-man was hounded them for trying to fuck me over and their friendship soured.

Freelancers, always sign contracts. Make sure you take money up front as well. If they don't want to cough up anything, you're probably in for a huge headache.
ephemeral garbage
Member
(04-05-2011, 05:10 PM)

ephemeral garbage's Avatar
#237

Ok, here is an actual coding test I use for Android devs. I'm not the only interviewer, this isn't the only test, etc. etc. etc.

I usually don't have enough time to actually go into detail about Android (because doing anything interesting in Android requires running the code generating toolchain about about 12 pounds of XML) but I can ask some limited-scope Java stuff. I start with this:

Code:
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.
  }
}
Usually, after a couple of questions about probability distribution (and this is IMPORTANT - I am SO HAPPY if someone asks for clarification. That person is going to be awesome to work with. The person who stalls and is too scared to look stupid and then writes something completely incorrect is not going to be a good co-worker) they'll come up with an implementation like this:

Code:
  public boolean didDefend() {
    return java.util.math.Random() < defense;
  }
Usually, people are attracted to the simplicity of a one-liner so they almost always do this (if they understand what's going on at all). They might use <= instead of <, that's totally fine. However, according to the spec, this method needs to specifically handle 0.0 and 1.0 absolutely, and if you do a single comparison, you're going to miss one of those edge conditions: for example, the implementation above will erroneously return false if chanceOfDefending is 1.0, and the RNG just happens to return 1.0.

At this point it turns into a conversation about unit testing, and how one can lift the generation of the random number out of this method so we can inject a stub RNG that will allow us to test edge conditions like this. I usually get a lot of different answers for this, some people have worked with mocking frameworks and will talk about how to use that, some people haven't and will explain how you would go about rolling your own. There isn't a specific right answer, but I'm looking for reasoning that would convince me that this person understands what the boundary conditions are, and what would constitute sufficient testing.

One thing that is important to me about this test is that it is administered conversationally and cooperatively. I'm asking questions to someone I'm potentially going to be working with, I'm not trying to surprise or intimidate them. I'm seeing if they can reason about code.
Last edited by ephemeral garbage; 04-05-2011 at 05:15 PM.
ultron87
Member
(04-05-2011, 05:11 PM)

ultron87's Avatar
#238

Originally Posted by The_Technomancer:
Alright, so the basic three modulus check version of Fizzbuzz looks perfectly straightforward. How would you optimize it to less code?
Well you really only need two modulus calls if you use IFs instead of the else ifs.
Drkirby
Corporate Apologist
(04-05-2011, 05:26 PM)

Drkirby's Avatar
#239

My TA for our lab showed us a function someone wrote in our Java Class to find the factors of a number after class. (It was the first assignment for the class, so the specifications were pretty lax and we could print the same pair more then once)

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
Member
(04-05-2011, 05:28 PM)

nickcv's Avatar
#240

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.
Kalnos
Banned
(04-05-2011, 05:34 PM)

Kalnos's Avatar
#241

Originally Posted by nickcv:
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.
Talking about your last boss is bad... really bad.

That's one of the biggest no-no's that I know of in an interview.
ronito
got my tag in the OT
(04-05-2011, 05:36 PM)

ronito's Avatar
#242

all developers are arrogant though. It's a matter of how arrogant you can put up with.

Talking about blowing interviews.
I once interviewed a dev that passed with flying colors. And at the end I decided to ask just one more question before I called in my pass. I saw that he had worked for a company that I knew was pretty good at employee retention. I asked him "I see you left company x. People tend not to leave that company. Why'd you leave?"

He replied with "Oh yeah I got totally jewed out a promotion."

I was shocked. The guy destroyed his entire interview with the last sentence. Can't imagine how he thought that was an OK thing to say in an interview.
ephemeral garbage
Member
(04-05-2011, 05:40 PM)

ephemeral garbage's Avatar
#243

Whoa.

Are you sure he didn't say 'screwed'?

Because..

whoa.
ronito
got my tag in the OT
(04-05-2011, 05:42 PM)

ronito's Avatar
#244

Originally Posted by Not A Fur:
Whoa.

Are you sure he didn't say 'screwed'?

Because..

whoa.
yeah no mistaking the "J" in there.
nickcv
Member
(04-05-2011, 05:47 PM)

nickcv's Avatar
#245

i don't get it o.o

i know what jews are but i don't know what that means.
ronito
got my tag in the OT
(04-05-2011, 05:50 PM)

ronito's Avatar
#246

Originally Posted by nickcv:
i don't get it o.o

i know what jews are but i don't know what that means.
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
Member
(04-05-2011, 05:53 PM)

nickcv's Avatar
#247

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
got my tag in the OT
(04-05-2011, 05:56 PM)

ronito's Avatar
#248

Originally Posted by nickcv:
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
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
Member
(04-05-2011, 06:00 PM)

nickcv's Avatar
#249

Originally Posted by ronito:
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.
that's really twisted
Ecrofirt
Member
(04-05-2011, 06:10 PM)
#250

Rant:

The goddamn XNA game I'm working on is pissing me off. I'm getting terrible framerates and I can't explain why at all.

Hell, I've only got a total of 12 sprites on screen, and they're all using the same damn texture.

I've tried with both displaying them and not displaying them, and the framerate bounces around. God forbid I attempt to move them at all, or it consistently dips below 60fps.

What in the blue fuck!