Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

02-26-2014 , 01:15 AM
Quote:
Originally Posted by kerowo
LMAO, "not knowing how to code is preventing me from being a developer, I'll just lie about that on my resume." How about flipping it around, would you want to work with someone who only got the job because they lied about their qualifications?
Well, apparently these people do know how to code and have projects with a github to prove it. The problem is starting from zero after a long-term unemployment. It's hard enough to get a job stuffing envelopes when you have a massive hole in your resume.

No one is advocating applying to a job and walking in and saying "Python? I heard it has whitespace, lol!" then failing fizzbuzz.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 01:19 AM
I really thought people failing fizzbuzz was an exageration. My manager uses it every interview and always tells me when people fail. Its crazy often
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 01:46 AM
Hah - I've never heard of fizzbuzz before. I guess we've kind of come up with our own version that's been surprisingly effective in weeding out JS devs who can't think for themselves.

"Imagine you want to create an NxN square with a random number in each square. First how would you go about creating that data structure?" I **** you not about half of our candidates have struggled with it. Even the ones who get it right have come up with wildly different answers. The session usually devolves into the senior devs getting into a deep theoretical JS argument about whether or not you can do this with one for loop, while the bewildered applicant looks on.

At the last one my coworker add a new wrinkle that just makes it abusive imo - the squares have to be populated by a unique random number from 1 to NxN. The dude totally nailed it though, then failed his drug test. Sigh - ****ing corporations. He even had a medical marijuana card AND he's just a contractor. Yeah that will get the best and the brightest - stupid lawyer/liability hoops to jump through.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 02:30 AM
Code:
var N = 5;

var allNumbers = new Array(N*N+1).join('0').split('').map(function(x,i) { return i+1; });

allNumbers.forEach(function(x,i,arr) {
  var randIndex = Math.floor(Math.random()*arr.length);
  var temp = arr[randIndex];
  arr[randIndex] = arr[i];
  arr[i] = temp;
});

var matrix = allNumbers.reduce(function(prev, cur, i) {
  if (i % N == 0) prev.push([]);
  prev[prev.length-1].push(cur);
  return prev;
}, []);

console.log(matrix);
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 02:58 AM
You're hired!

Seriously though that's pretty cool and very inventive. I had to play around with it a bit in fiddle to figure out what's going on. If I wrote that I would definitely have to comment each block so I didn't scratch my head for 30 minutes when I have to come back to it in 6 months.

I've barely used map and reduce, I should start using them more - those are pretty powerful.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 03:00 AM
anyone have some clean urine to spare?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 03:37 AM
FYI you can also cut out the middle block by randomly splicing the sequential numbers off the array:

Code:
var N = 5;

var baseArray = new Array(N*N+1).join('0').split('');
var allNumbers = baseArray.slice(0).map(function(x,i) { return i+1; });

var matrix = baseArray.reduce(function(prev, cur, i) {
  if (i % N == 0) prev.push([]);
  var unique = allNumbers.splice(Math.floor(Math.random()*allNumbers.length), 1)[0];
  prev[prev.length-1].push(unique);
  return prev;
}, []);

console.log(matrix);
I'm not sure reduce is still needed here but I doubt it would be any cleaner w/o it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 06:16 AM
Quote:
Originally Posted by kerowo
LMAO, "not knowing how to code is preventing me from being a developer, I'll just lie about that on my resume." How about flipping it around, would you want to work with someone who only got the job because they lied about their qualifications?
A bad lie is one that can be figured out immediately. If you put programming skills on the resume and don't have them...that should become obviousl during the interview.

I'd much rather work with someone that lied to get past the HR-filters than with someone that has a bunch of nice "certificates" and checks out on paper without a lie but can't actually get **** done.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 07:31 AM
Quote:
Originally Posted by PJo336
I really thought people failing fizzbuzz was an exageration. My manager uses it every interview and always tells me when people fail. Its crazy often
We also have a fizzbuzz equivalent that we use. People rarely fail it outright but more often take way too long and struggle too much with it that we know we won't hire them.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 08:27 AM
Quote:
Originally Posted by suzzer99
The session usually devolves into the senior devs getting into a deep theoretical JS argument about whether or not you can do this with one for loop, while the bewildered applicant looks on.
here's one loop, didn't bother to ugly up the code making sure theyre unique though. I don't think I could make it unique without another loop to either build an array of unique numbers or to check for uniquness against some record. much less readable than a more functional style imo.

Code:
var buildNxN = function(n) {
  var nSquared = n*n,
      i = 0,
      j = 0,
      nByN = [];
  for(; i < nSquared; i++) {
    nByN[j] = nByN[j] || [0];
    nByN[j][i%n] = Math.floor(Math.random() * nSquared);
    if (i%n === 0 && i !== 0) j++;  
  }
  return nByN;
};

var x = buildNxN(7);
console.log(7);
too bad I'm a lowly peasant and not allowed to work for corporations
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 09:52 AM
On interviewing, are there really a lot of candidates that apply got developer jobs that don't know very much about coding. Most interviews that I know of seem to be geared for guarding against that. I guess it might be true for inexperienced candidates.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 10:09 AM
Quote:
Originally Posted by adios
On interviewing, are there really a lot of candidates that apply got developer jobs that don't know very much about coding. Most interviews that I know of seem to be geared for guarding against that. I guess it might be true for inexperienced candidates.
Ya. When I was interviewing many Java and C# consulting shops wanted anyone with an engineering/science/math background (regardless of programming experience). Obviously this is not the case at top software companies but there's a huge market for grunt .Net and Java work out there.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 10:20 AM
Quote:
Originally Posted by jjshabado
We also have a fizzbuzz equivalent that we use. People rarely fail it outright but more often take way too long and struggle too much with it that we know we won't hire them.
I realize that this is a simple exercise but not sure it is accomplishing what your organization wants it to accomplish. This seems like an exercise to weed out people who are lying about their development skills. If they can't meet expectations in doing this problem they're not really competent. In my view interviews are stressful so flubbing a problem like this, especially in an interview setting, may not be that big of a deal. A sloppy solution to me from an otherwise competent candidate wouldn't necessarily be a deal breaker. How often does your organization demand that developers design algorithms that require the skills to solve FuzzBuzz like problems?

I can understand if a lot of people are getting interviews that aren't competent but not sure this kind of test means all that much. If the candidate is writing code on a white board I'm sure it doesn't mean that much. The candidate will probably developing code on a workstation. Just an example.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 10:25 AM
Quote:
Originally Posted by muttiah
Ya. When I was interviewing many Java and C# consulting shops wanted anyone with an engineering/science/math background (regardless of programming experience). Obviously this is not the case at top software companies but there's a huge market for grunt .Net and Java work out there.
Are there a lot of candidates that apply for these "grunt" positions that don't have the necessary skills? The word "grunt" implies to me that the bar is pretty low on the skill set requirements.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 10:41 AM
Quote:
Originally Posted by suzzer99
FYI you can also cut out the middle block by randomly splicing the sequential numbers off the array:
while i like the extra brevity, i don't like mixing the steps of shuffling and transforming the data into its final format. that is, i think the high level algorithm is clearer written as 1. create the data 2. shuffle the data 3. put the data in a matrix.

if you introduce a separate shuffle method, such as eg ruby has built in, that kind of gross middle section of mine (step 2) becomes a single line. also i am not crazy about the reliance on mutation with splice, although my solution mutated in step 2 as well.

That is to say, the big problem here is with the expressiveness of js. ruby solution (which could probably be made even shorter):

Code:
(1..25).to_a.shuffle.each_slice(5).to_a
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 11:03 AM
Quote:
Originally Posted by adios
I realize that this is a simple exercise but not sure it is accomplishing what your organization wants it to accomplish. This seems like an exercise to weed out people who are lying about their development skills. If they can't meet expectations in doing this problem they're not really competent. In my view interviews are stressful so flubbing a problem like this, especially in an interview setting, may not be that big of a deal. A sloppy solution to me from an otherwise competent candidate wouldn't necessarily be a deal breaker. How often does your organization demand that developers design algorithms that require the skills to solve FuzzBuzz like problems?

I can understand if a lot of people are getting interviews that aren't competent but not sure this kind of test means all that much. If the candidate is writing code on a white board I'm sure it doesn't mean that much. The candidate will probably developing code on a workstation. Just an example.
A simple programming question done early in a phone screen is by far, like not even close, the single best interviewing question/technique. It doesn't require much time investment, gives you very few false negatives, and probably weeds out about 50% of the people you choose to interview.

Very few people are so nervous that they flub basic programming questions. And even if it is a matter of nerves, it means I'm just not going to be able to figure out what skills they have in a standard interview. I'm always going to prefer passing on the rare nervous good candidate then hire people that I can't verify know how to program.


Quote:
Originally Posted by adios
A sloppy solution to me from an otherwise competent candidate wouldn't necessarily be a deal breaker. How often does your organization demand that developers design algorithms that require the skills to solve FuzzBuzz like problems?
And just on this part, what kind of programming job doesn't require regular use of for loops and if statements? Thats the whole point of a FizzBuzz type problem, the 'algorithm' if you will is obvious and its just up to the candidate to use simple programming techniques to implement it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 11:27 AM
Quote:
Originally Posted by adios
Are there a lot of candidates that apply for these "grunt" positions that don't have the necessary skills? The word "grunt" implies to me that the bar is pretty low on the skill set requirements.
At least in the Toronto area there are a ton of these shops. There is higher demand than supply of developers. By grunt I mean pretty boring enterprisey .Net type stuff. You still need to write code but it's nothing too exciting. Your vanilla business app. New devs are expected to learn coding (they provide some minimal training). Good devs avoid these jobs because it's 60+ hours for crap pay in the first few years.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 11:34 AM
The hardest part about FizzBuzz is implementing the modulo operator :P

Maybe a naive question but I've never done a phone interview for an IT job...what's a simple programming question via phone and how would one answer it? Like would you describe FizzBuzz and the guy says something like "I'd use modulo 3,5,15 to check if the case is met in an if then else block...yadayada"?

It's really hard for me to understand how one would fail a FizzBuzz level question...I mean if I can't do that there's no way I can write any meaningful program and why on earth do they even apply?
I can fully understand failing on some easy task that involves even the easiest algorithms (implement quicksort) because one uses libraries for everything etc...but FizzBuzz...kinda blows my mind.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 11:52 AM
We do all of our phone interviews with both the interviewer and the candidate at a computer. For coding questions we use: http://collabedit.com/. It's pretty awesome.

In all interviews I give my standard disclaimer about how I know that collabedit/white boards/paper are not real programming IDEs so I don't care about minor syntax errors or if they call the 'size' function 'length' or whatever.

And like I said, it's not like they 'fail' the question outright very often. It's much more that they struggle a lot and take way too long. Or you'll see them do weird things like writing code around the hard coded example input you gave (instead of using a variable). Or they'll throw in things like static and be unable to explain what it does. And so on.

An amazing candidate can knock out our fizzbuzz question in about 2-3 minutes. Aside from rare special circumstances (like they just misunderstood the question or had one obvious brain fart) I don't think it should ever take a decent programmer more than 15 minutes to do our question.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 12:27 PM
Also, am I missing some JS thing that makes suzzer's question more complicated than it is?

Code:
var matrixGen = function(n) {
  result = [];
  for (i = 0; i < n; i++) {
    result[i] = [];
    for (j = 0; j < n; j++) {
      result[i][j] = Math.random();
    }
  }
  return result;
}
Replace the assignment statement with whatever modification you want based on the answer to "What kind of random number do you want? Range? Integer? ..."

And for the uniqueness twist, just add a separate check.

Edit: Just re-read the question. Didn't realize the uniqueness constraint included the range of numbers in the array.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 12:57 PM
Quote:
Originally Posted by clowntable
It's really hard for me to understand how one would fail a FizzBuzz level question...I mean if I can't do that there's no way I can write any meaningful program and why on earth do they even apply?
You can always move up to management when they figure out you can't code.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 02:13 PM
Quote:
Originally Posted by jjshabado
Also, am I missing some JS thing that makes suzzer's question more complicated than it is?
jj,

not really, although it's kind of hard for me to read your snippet clearly after the nested for loops made me vomit on my monitor.

that is to say: web scale functional mongo i play in a band and knit imperative programming rotflol!!!!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 02:39 PM
There's nothing wrong with nested for loops if they don't actually cost you anything wrt performance. You're doing N^2 operations regardless of if you're doing one for loop or two.

My general advice, especially to inexperienced people, is that you should keep your solution in an interview as simple as possible.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 02:40 PM
jj's solution is very similar to what I got too.

I still think like an imperative communist, but the ruby solution made me smile brighter than a thousand suns.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-26-2014 , 02:50 PM
Quote:
Originally Posted by jjshabado
There's nothing wrong with nested for loops if they don't actually cost you anything wrt performance. You're doing N^2 operations regardless of if you're doing one for loop or two.

My general advice, especially to inexperienced people, is that you should keep your solution in an interview as simple as possible.
in all seriousness, i actually do think they are less readable. in this simple example, no it doesn't matter a ton and either way you can figure out pretty fast what the code is doing, but the difference adds up considerably across an entire code base. any time i see nested anything i kind of wince. what you view as simpler depends partly on what you're comfortable with, but i'd argue the functional solutions are conceptually simpler, and especially in the context of a supporting library (think the ruby example above or adding methods like "shuffle" and other array utilities in js) they lead to code that's much more concise and readable.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m