Our experience is that the answers to fizzbuzz are a good classification criteria in vetting who has got programming abilities and who has not. Most people who actually try can solve it, but the ones who are talented give out either a perfect and simple solution or do something elegant and go for the style points. The ones who don't give out a fumbling solution that is too long or shows signs of not being comfortable with the task at hand, even if they manage to write a computer program that produces the correct results.
As silly as it may sound, the fizzbuzz test is a good classifier for programmers. I didn't believe it until I saw the evidence from the quality of candidates we got.
But not being able to do it is a very strong signal that someone can't program in any professional setting, no matter what they pretend. It's a very simple and effective test to rule out people who think/pretend they can program, but really can't.
bool divisible_by(int a, int b) {
return a==((a/b)*b);
}
It doesn't require anything more than knowledge about what division means, and I think it's fair play to require such knowledge from programmers.a and b are ints, so a/b is truncated (rounded down) before applying *b.
Definitely not a gimmick question about whether you know about modulus.