Earlier quoted context omitted.
This would be an offer on the spot from me
> me: It's more of a "I can't believe you're asking me that." > interviewer: Great, we find that candidates who can't get this right don't do well here. > me: ... Shit attitude from that candidate, considering the interviewer is completely correct. I wouldn't hire them since they are obviously a problem employee. For those that don't know, Fizz Buzz is less an aptitude test and more of an attitude test. That's why th…
Solving Fizz Buzz with Cosines
11–20 of 69 posts
Re: Solving Fizz Buzz with Cosines
#12Earlier quoted context omitted.
This would be an offer on the spot from me
> me: It's more of a "I can't believe you're asking me that." > interviewer: Great, we find that candidates who can't get this right don't do well here. > me: ... Shit attitude from that candidate, considering the interviewer is completely correct. I wouldn't hire them since they are obviously a problem employee. For those that don't know, Fizz Buzz is less an aptitude test and more of an attitude test. That's why th…
The amount of (highly credentialed) interviewees that can't 0-shot a correct and fully functional fizzbuzz is also way higher than a lot of people would think. That's where the attitude part also comes in.
Re: Solving Fizz Buzz with Cosines
#13Re: Solving Fizz Buzz with Cosines
#14Well, there must be an obvious solution where the fizzbuzz sequence is seen as a spectrum of two frequencies (1/3 and 1/5), and a Fourier transform gives us a periodic signal with peaks of one amplitude at fizz spots, another amplitude at buzz spots, and their sum at fizzbuzz spots. I mean. that would be approximately the same solution as the article offers, just through a more straightforward mechanism.
Also probably easy enough to encode as quantum superpositions.
Re: Solving Fizz Buzz with Cosines
#15EDIT: the llm gods do recreational mathematics as well. claude actually thinks it was able to come up with and verify a solution...
https://claude.ai/share/5664fb69-78cf-4723-94c9-7a381f947633
Re: Solving Fizz Buzz with Cosines
#16Well, there must be an obvious solution where the fizzbuzz sequence is seen as a spectrum of two frequencies (1/3 and 1/5), and a Fourier transform gives us a periodic signal with peaks of one amplitude at fizz spots, another amplitude at buzz spots, and their sum at fizzbuzz spots. I mean. that would be approximately the same solution as the article offers, just through a more straightforward mechanism.
Of course, we could calculate the DFT using a tool, and from there work out the coefficients for the cosine terms. For example, we could get the coefficients for the exponential form like this:
https://www.wolframalpha.com/input?i=Fourier%5B%7B3%2C+0%2C+...
And then convert them to the coefficients for the cosine form like this:
https://www.wolframalpha.com/input?i=%7B11%2F15%2C+2*0%2C+2*...
That's certainly one way to avoid the tedious work but I decided to use the shortcuts as the basis for my post because I found this approach more interesting. The straightforward DFT method is perfectly valid as well and it would make an interesting post by itself.
Re: Solving Fizz Buzz with Cosines
#17Re: Solving Fizz Buzz with Cosines
#18Re: Solving Fizz Buzz with Cosines
#19Well, there must be an obvious solution where the fizzbuzz sequence is seen as a spectrum of two frequencies (1/3 and 1/5), and a Fourier transform gives us a periodic signal with peaks of one amplitude at fizz spots, another amplitude at buzz spots, and their sum at fizzbuzz spots. I mean. that would be approximately the same solution as the article offers, just through a more straightforward mechanism.
Yes. Exactly. This is how it _should_ have been done. Also probably easy enough to encode as quantum superpositions.