6 ms·
The problem is that Fizzbuzz and string reversing are a kind of trick questions. Either you have already done them or not. Good people will fail at trick questi
by p0nce 11y ago
The problem is that Fizzbuzz and string reversing are a kind of trick questions. Either you have already done them or not. Good people will fail at trick questions very easily in interviews.
Since they don't represent real work and aren't statistically significant, why are we using them? They are merely adding random noise in the interview process.
- _Codemonkeyism 11y agoNot sure how FizzBuzz is a 'trick question'. Given these instructions at an interview: 'Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.' It spells out in words what needs to be written in code. String reverse is: Write a method/function that returns the reverse of it's argument. Would be interested to learn how these are trick questions.
- imtringued 11y agoNot everyone has the entire unicode spec in their head.
- _Codemonkeyism 11y agoI usually go with ascii. If the solution is fine, I ask were they see problems. Some mention UTF-8/16. I'm happy if someone tells me this is tricky and there is a working solution in library X or they would google for a solution that works with UTF-8/16.
- ckuehne 11y agoHow is Fizzbuzz a trick question?
- kefka 11y agoTo someone who can't do it, it is a trick question. The "trick" is the first hump - a goat.
- p0nce 11y agoargumentum ad hominem (edit: was never asked to do Fizzbuzz)
- kefka 11y agoNot at all. Even a simple programming question can stump someone not trained in it. I've seen people who (supposedly) have computer science degrees fail on FizzBuzz. In the end, it makes some sense to "talk shop" about programming issues. If they can't follow, it's probably not a good idea to hire them.
- p0nce 11y agoFrom this thread you'll find people that will reject someone with 10 years of experience because of failing Fizzbuzz in the conditions of an interview. It's not always used to talk shop. What I say is that there are things that are probably more statistically significant that questions with gotchas.
- HeyLaughingBoy 11y agoSo? I've interviewed people with graduate Computer Science degrees who couldn't program a for {...} loop. Blew my mind, but it happened enough times that it doesn't surprise me any more.
- pbh101 11y agoGoing to echo this sentiment: I think the only way FizzBuzz is a trick question is if you aren't familiar with the modulus operator, in which case I think it fair to say you haven't spent much time programming. That being said, I'm assuming the failure mode we're discussing is 'flailing at the whiteboard and would never make any progress given infinite time' and not 'wrote an off-by-one error that a unit test would catch.'
- mrob 11y agoEven if you've never heard of the modulus operator, it's still easy, eg in Python: fizz = 3 buzz = 5 both = 15 for i in range(1, 101): if i == both: print "FizzBuzz" both += 15 fizz += 3 buzz += 5 elif i == fizz: print "Fizz" fizz += 3 elif i == buzz: print "Buzz" buzz += 5 else: print i
- woofyman 11y agoIf you can't write your own modulo function if don't understand the fundamentals of integer/floating point operations. Or are unaware of ceil and floor functions.
- p0nce 11y agoFizzbuzz trick: you have to make a special case for modulo 15, you can't reuse the 3 and 5 cases. string reversing in place trick: stopping at the middle else it's an identity function. Any time you spend with Fizzbuzz, you could spend it on more complete quizzes, discussing past experiences, taking references etc.
- QuercusMax 11y agoAnd if the candidate trips up, this gives you an opportunity to walk through a virtual compile-debug-test cycle. When I asked these kinds of questions I would execute the program in my head, and tell the candidate things like "your reverse() methods moves some stuff around, but the end result appears the same as before". Or "this fails with ArrayIndexOutOfBounds on line X". Typically it only took a few minutes to find the bug and fix it, and I learned about how the candidate solves problems.
- skj 11y agoI find it unlikely that good people will fail to do string reversing if they haven't seen it before. I find it much more likely that the fizzbuzz failers are the students who wanted to copy my programming projects in undergrad.
- p0nce 11y ago> I find it unlikely that good people will fail to do string reversing if they haven't seen it before. I've seen this for people that were hired and proved excellent. Everyone can do Fizzbuzz or reverse a string on the job. Much less can do it correctly the first time, on a whiteboard, in a job interview. When you hire a carpenter, you don't ask him to hit a nail with a plastic hammer while you watch.
- takno 11y agoCertainly you can learn Fizzbuzz and string reversing, meaning that you could be a false positive in the interview. Assuming that you are interviewing experienced devs and you use the test as a kicking-off point for discussing any errors rather than as an opportunity for calling the candidate an idiot, you are unlikely to hit false negatives. Even in these circumstances I've had a decent proportion of candidates never able to even begin to outline some code, let alone get far enough in to enounter "tricks" or "pitfalls". These are candidates I'm comfortable assuming have not learned to code.
- thenipper 11y agoThat blows my mind. I believe you it's more like what are people learning with these degrees? I code for fun mostly and I feel like even my 'basic' level knowledge should be able to outline code for a simple problem like fizzbuzz or string reversal.
- mikestew 11y agoGo read up on the origins of FizzBuzz. It was intended to filter out the non-coders, despite what their resume might say. That was Spolksy's problem: BS in CS, resume otherwise looks good, get them in for a tech interview and they simply bomb. Mind still blown? Yeah, well, it happens more than you think. Varying definitions for "SDET" are out there, but I think most would agree that an SDET should be able to code. I've had SDETs with Microsoft on their resume that couldn't even match curly braces, let alone write something that would compile and work. So I use FizzBuzz or an equivalent. I tell the candidate up front that it should take them single digit minutes. I offer points for creativity if they find it too simple. And once in a while a candidate with ten years experience shows up who can't do it. Glad we didn't start with that red/black tree implementation, then.
- thenipper 11y agolate reply.. but damn thats crazy. Admittedly I'd get lost on the red/black tree but a basic loop and modulus is pretty much like CS101...
- cm3 11y agoWhen presented with a trivial programming task in an interview, I'm partly questioning whether there's something deeper I'm missing or if it's a basic challenge like "did you ever write any code yourself?". That's why some might perceive it as a trick question.
- cubano 11y agoIn my experience if a tech hiring person is playing with "trick" questions during an interview you should very quickly start wondering if this would be a place you really need to work.
- cm3 11y agoMaybe, but I wouldn't be surprised if it's not up to them what the questions are.
- _Codemonkeyism 11y agoYes this happens, some developers overthink things and think meta then meta then meta. This makes it especially tricky to do surveys ("what does the question really mean?") with developers from my experience. When this happens to me, people in the interview tell me something like "This is easy, are there strings attached I can't see?"
- cm3 11y agoIt's because some interviews try to have you solve hard problems, expecting you to have a solution ready in 5 minutes, whereas in the real world you'd consult literature for that. Whatever happened to, "he seem to be able to code, let's try it for a couple weeks"? Happened to me twice where everything was fine and then after having been interviewed by 5 or more people, one of them has a bad feeling, and you're not given a chance to prove yourself in a probationary period. Situations like that made me wonder if freelancing is a better path.
- kagamine 11y agoNever had cause to reverse a string but have needed to reverse an array. Never had cause to do something like fizzbuzz but have needed modular operator (actually both in the same function) but if I had never had reason to validate barcodes of differing lengths and validate the check-bit, I would probably fail on fizzbuzz too. In fact I probably would fail today if asked, who has time to remember something that useless, and that easy to look up?
- distances 11y agoFizzbuzz or string reverse aren't something to remember. They are small logic puzzles that programmers should be able to easily figure out in an interview, even if they have never heard of them. Unless, perhaps, the candidate gets so stressed that they lock up and fail to think straight, which is of course totally plausible.
- _Codemonkeyism 11y agoI agree, but wouldn't call string reverse a logic puzzle, only if all programming is logic puzzles.
- _Codemonkeyism 11y agoI would like to learn and understand how you think you would fail on FizzBuzz if you get these instructions [1]: 'Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.' [1] if stuck on modulo I usually suggest to assume there is a function divisible
- Joof 11y agoFor me? Anxiety largely. And probably over engineering the problem trying to demonstrate skill beyond fizzbuzz.
- kagamine 11y agoI have a terrible memory and struggle to be confident, I would probably just not manage to write anything under interview conditions. When I first learned about fizzbuzz I did it and wondered what all the fuss was about, it's not a complicated logic puzzle, just that I'm used to writing code while connected to the Internet, my brain simply doesn't try to remember things I know I can look up in 1 second.
- kriro 11y agoI disagree. What's tricky about a naive solution for FizzBuzz? The only argument I could think of is "well it uses modulo which isn't all that standard". Not knowing modulo (or "how do I check if a number can be divided by another number") is a very bad sign (imo)...the rest is printing stuff, branching, a loop, methods/functions and getting a program to run (+maybe TDD). Those are all rather fundamental building blocks.
- _Codemonkeyism 11y agoUsually modulo is not a problem, if stuck I suggest candidates assume there is a function divisible that returns true or false.
- golergka 11y agoWhat. If someone perceives "FizzBuzz" to be a "trick" question, he's exactly the kind of person FizzBuzz question should weed out as fast as possible.
- magni- 11y agoIf you're a programmer, you can write FizzBuzz. Whenever I do a first technical screen, I always start with FizzBuzz - explicitly telling the interviewee it's just to warm them in before we get to the real stuff. No trick there.
- p0nce 11y agohttps://news.ycombinator.com/item?id=11497607 https://news.ycombinator.com/item?id=11497607
- MustardTiger 11y ago>The problem is that Fizzbuzz and string reversing are a kind of trick questions. They are the exact opposite. They are practical, very simple, introductory questions. Fizzbuzz is literally "do you know what a loop and a conditional are?".
- hyperpape 11y agoString reversal at least involves a backwards loop, which isn't that hard, but you don't use often in practice. I'd guess there are 10x as many for-of loops as for i = 0...loops in our codebase, and 10x as many for i = 0...loops as backwards loops in our code base. I think Swift may be removing C-style for loops, even (https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001978.html https://lists.swift.org/pipermail/swift-evolution/Week-of-Mo...). Of course you can still express it using a while-loop, but this reflects the frequency of certain types of code. On the one hand, I'm tempted to say everyone should be able to do that, on the other hand, they do feel like a type of programming that isn't super common in a lot of applications. FizzBuzz is probably a bit better in that regard.
- distances 11y agoNot necessarily a backwards loop, it can be done just fine with a simple recursion too. If a candidate can't do either, well, this is a task explicitly to weed out those candidates.
- bloaf 11y agoSeriously? The sum total of my undergrad programming experience was a Fortran/Matlab course and I was able to write a FizzBuzz implementation when I first heard about it. As an outsider, the idea of a professional programmer not being able to write a FizzBuzz implementation sounds as ridiculous as a pharmacist who couldn't tell you what sudafed was for or a mechanic who couldn't replace an oil filter.
- cb18 11y agoIf you've not done something similar to fizzbuzz, then you're not a programmer. Programming is all about abstraction. And fizzbuzz is an abstraction of a huge range of programming work. Namely: go through this data pull out bits, based on these conditions then do something with it Some version of that underlies the vast majority of programming work.