32 ms·
I don't even know if this is the answer. The reason being I have never needed to work with fractions or with the modulus operator (I'm 12 years out of school,
by va_coder 17y ago
I don't even know if this is the answer. The reason being I have never needed to work with fractions or with the modulus operator (I'm 12 years out of school, which is the last time I need it). The only reason I know about it is because I was asked about a question involving the modulus character in an interview.
But I can tell you I have had many clients that have been happy with my work.
<code>
for (e in 1..100) {
if ((e % 3 == 0) && (e % 5 == 0)) { println "FizzBuzz" }
else if (e % 3 == 0) { println "Fizz"}
else if (e % 5 == 0) { println "Buzz"}
else println e
}
</code>
- RiderOfGiraffes 17y agoBingo. That's good enough to avoid having your resume deep-sixed. The next stage would depend on the position you're applying for, and whether it's algorithms, web, systems, maintenance, whatever. There are now several questions I could pursue, but that's enough to get you through the door, offered a beverage of your choice, and effectively courted. By the way, not knowing what the modulus operator is no bar - all you have to do is write: if is_divisible_by(n,d) ... or something similar, and then say - "I'd need to look up the idiomatic way to do that in your language of choice." But you are already way ahead of the game. FWIW, when we have been hiring (which we aren't now, by the way) the person who wrote something like that got the job. And yes, out of several tens of applications, only one could do it.