10 years ago I was asked how to tell if an integer is divisible by two without using division or modulus. What they expected was to bit mask the 1s place in the integer and check for equality with 0.Wait, it gets better. I was asked the "divisible by two" question and gave the standard bitmasking technique in response. But then my interviewer said that wasn't "allowed" either, because apparently this programming environment they do their daily work in (this was an old-school web development shop basically) doesn't support basic math operations of any kind except equality, plus and minus.
He then pressed me for something "even simpler", "perhaps using function calls". Then I figured out what the "right" answer was -- he wanted be to test for odd- or even-ness recursively by, well, you know how.
So after reminding him about the obvious performance drawbacks of such an approach, I asked him -- "So do you actually write code like this in production?"
To which his answer was: "No, but I do during interviews".