3 ms·
Plus some of these require background knowledge, for example some candidates won't know what a Fibonacci number is or how to calculate one (since they literally
by Someone1234 11y ago
Plus some of these require background knowledge, for example some candidates won't know what a Fibonacci number is or how to calculate one (since they literally haven't covered it for twenty+ years).
So be careful what you're ACTUALLY testing.
- DanBC 11y agoThe point of FizzBuzz is that you can give candidates a description of the problem and also give them the mod operator and a sample of its usage and some people would still fail. It would be great if there were some actual research on this. (How many people who claim to be able to program cannot create fizzbuzz in an hour even if you give them a description of modulo) I suspect that a lot of it comes from "programming sheep and goats", which was later withdrawn by its author.
- lsiebert 11y agoYou don't actually need the modulo operator though. Modulo is effectively x - x * (x/y) with integers but you don't even need that. You can do something like this. #include <stdio.h> #include <stdbool.h> int main(void) { int five = 5; int three = 3; int count; bool numprint; for (count = 1; count <= 100; count++){ numprint = true; if (count - three == 0) { three += 3; printf("Fizz"); numprint = false; } if (count - five == 0) { five += 5; printf("Buzz"); numprint = false; } if (numprint) { printf("%d", count); } printf("\n"); } return 0; }
- soham 11y agoYep, point is not to test if they know Fibonacci or prime numbers. If the candidate has forgotten, then you just tell them what those things are. And then expect them to answer it. But here is the (sad?) reality: There will always be someone else applying for the same job, who knows what fibonacci numbers are. You have to be careful to give equal opportunity to both those kinds of people.