Having interviewed close to a hundred people in a year for a senior C dev position I can assure you that people lie like you wouldn't believe. They cheat with take-home tasks, they show others' code as their own. And that's in the system programming circles, where the level of professionalism is typically much higher than in app/web development areas. We got burnt really bad when a brilliant dude whom we relocated across the country turned out to be the laziest moron I've ever had a misfortune to work with. So you bet we started most of the interviews with fuzz-buzz kind of questions.
For my next job, I've thought about offering to work for free for a week or so as a kind of mutual trial period. I want to know what the entire office is like, what the codebase is like, what the tools are like, and what actually needs to be done. If they want to rip me off and get a week of free work, great! That's exactly the kind of thing I would want to know about a company upfront. And after that week, they should know the degree to which I'm a fraud and be excited to pay me commensurately.
I know this wouldn't work for most potential employees since they don't quit their jobs until they have another one, but I always take a few months between jobs. I wonder how I might actually be able to pull this off..
P.s. I don't believe anyone actually fails fizz buzz.
It's not devs with > 3 years experience or even > 6 months. failing fizzbuzz. It's people _pretending_ to be devs with > 3 years experience. Or folks who started in programming years ago and drifted so far they can't get back to nuts and bolts. Or people who know the principles but can't express them. Or any number of other cases.
Like other folks have posted here in response, I've seen some really sad fizz buzzes in my day, often from people who had no business being near a computer let alone interviewing for a tech job, but somehow landed a phone screen.
And let's never forget the best/worst fizz-buzz ever: http://thedailywtf.com/articles/The-Fizz-Buzz-from-Outer-Spa...
I often read people say they'd be "insulted" if asked to do fizz-buzz, or would "walk out". I think that's an over-reaction - fair enough they need to make sure you're not useless and lying on your CV. As long as there's a more interesting follow-up question, I don't see the harm.
Out of 10, only 1 solved it well, 2-3 solved it acceptably (only edge case bugs), the rest never solved it, or had obvious bugs or code that would never pass peer review.
Of course, I could just be a shitty interviewer, but I always had a (changing) peer present during interviews, and I hope we were an honest enough company that they'd tell me if they thought I was.
You really don't realize how bad candidates can be until after you've interviewed dozens of them.
I was asked for my second job ever - on the phone - for commands that would list files in a directory, change directory, and create a symbolic link. I guess I've started doing that kind of prescreen now too
I implemented the thing, but with plus in place of multiplication. Before that, I realised I was struggling and asked the interviewer whether it was + or *, that was probably the moment he failed me.
I'm forced to maintain (or deploy) other people's Python code all the time. Personally, I would rarely choose it for a team project I have to maintain (if the choice is mine) because I've seen most teams commit the same annoying type errors over and over in every dynamic language I've ever used, including epecially Python. I've worked with much more competent Python programmers than myself who still do this.
But if I was on your team, I wouldn't complain and my code would be somewhere between pretty good to great. I would help the team ship that Python and ship it well.
I'm not sure what this rant says more about: me or this 'range vs xrange' question?
for i in range(n):
# your code here
because it potentially allocates a lot of memory for no reason whatsoever. It's the equivalent of this C code: int* r = calloc(sizeof(int), n);
for (int j = 0; j < n; j++) r[j] = j;
for (int j = 0; j < n; j++) {
int i = r[j];
// your code here
}
free(r);
If you don't want to deal with the distinction then what you can do is just treat range() as deprecated and always use either xrange() or list(xrange()) depending on the situation. But you had probably ought to know about the issue.And here's the thing: despite my rant, given that explanation, I'm going to have to say I respect that as a Python (2.x) interview question.
But that's because I care about performance optimization and good style in every language I use. I'm not sure that everyone else always should or that this should be a deal breaker for a python dev gig.
My Python is rusty, but I actually had to go look up the differences - my initial thought was "I'm pretty sure it used to be that range() generated a list and xrange() basically just iterated a value, but at some point range() was changed to use the xrange() behavior - I'd have to look it up to give you more detail than that." I didn't realize that xrange() had been completely removed from 3.x, for example. For that matter, I was thinking that both of them might have existed in 1.x, though it looks like they were added in 2.0.
http://pythoncentral.io/how-to-use-pythons-xrange-and-range/
From that article (buried near the end for some reason):
>One more thing to add. In Python 3.x, the xrange function does not exist anymore. The range function now does what xrange does in Python 2.x, so to keep your code portable, you might want to stick to using range instead.
https://docs.python.org/3/whatsnew/3.0.html#views-and-iterat...
So when the last company I interviewed at asked me "what is the difference between range and xrange in Python?" I just kind of rolled my eyes (on the inside). To me this is like asking a professional translator "what is the difference between 'si' and 'sí' in Spanish?" They were not interested in the thousands of lines of code I have on GitHub for my side projects, nor in a recent project that got me 15 seconds of fame. I ended that interview by saying "I don't think I'm a good match for this job".
Different companies have different cultures. It's good to be able to identify the kind of culture you want to work in, and even better to be able to respectfully decline an opportunity because it doesn't work for you. Don't become bitter and think that all companies want you to be a coding robot, just because Google and Facebook do (or seem to; I'm not sure how many of my friends who work there actually have that many side projects either). There are plenty of jobs that will work for you that won't work for me, and vice versa.