Earlier quoted context omitted.
&1[""] is the same as &(""[1])
Ah, so it's the nil address?
A way to torture an interviewer (C++, FizzBuzz)
31–40 of 84 posts
Re: A way to torture an interviewer (C++, FizzBuzz)
#32Yay, let's talk about FizzBuzz! This is the fastest PHP version I could come up with so far: I'm sure there still are ways to make it faster. But I fail to think of them. Except for unrolling multiple loops into one. But that is so ugly. Any ideas of elegant ways to make it faster? Testing the performance like this: php fizzbuzz.php | pv > /dev/null 215MiB/s on my slowish laptop. The "yes" command gives me about 10x…
Probably your implementation is limited by the speed PHP/echo can output things to stdout, rather than your implementation per-se. Better, use a benchmarking framework/library to see how many OP/sec you can do, within the PHP runtime, so you remove stdout from the benchmark.
There is a large FizzBuzz shootout here that I like:
https://codegolf.stackexchange.com/questions/215216
I think it's a nice "standard" for FizzBuzz comparison.
Re: A way to torture an interviewer (C++, FizzBuzz)
#33If a candidate were suggesting this as their serious FizzBuzz implementation fit for production, I'd have a hard talk with them about readability.
What implementation of FizzBuzz do you use in your production environment?
https://fizzbuzz.ketzu.net/to/100
(Also fun when you just outsource task in a language introduction task in a leetcode-like setting and get surprised it actually allowes you to make http requests...)
Re: A way to torture an interviewer (C++, FizzBuzz)
#34Re: A way to torture an interviewer (C++, FizzBuzz)
#35You wouldn't torture him. You would just zero the probability of getting an offer. There's no SW house or colleague in his right mind that would want a developer that writes obfuscated and needlessly complex to understand code.
Re: A way to torture an interviewer (C++, FizzBuzz)
#36Earlier quoted context omitted.
Probably your implementation is limited by the speed PHP/echo can output things to stdout, rather than your implementation per-se. Better, use a benchmarking framework/library to see how many OP/sec you can do, within the PHP runtime, so you remove stdout from the benchmark.
Well, that's part of the challenge. To write to stdout as fast as possible. There is a large FizzBuzz shootout here that I like: https://codegolf.stackexchange.com/questions/215216 I think it's a nice "standard" for FizzBuzz comparison.
Conflating the two seems to confuse more than measure anything useful.
Re: A way to torture an interviewer (C++, FizzBuzz)
#37I rather like this too - https://joelgrus.com/2016/05/23/fizz-buzz-in-tensorflow/
Re: A way to torture an interviewer (C++, FizzBuzz)
#38Re: A way to torture an interviewer (C++, FizzBuzz)
#39You wouldn't torture him. You would just zero the probability of getting an offer. There's no SW house or colleague in his right mind that would want a developer that writes obfuscated and needlessly complex to understand code.
QA engineer for a C++ compiler?
Re: A way to torture an interviewer (C++, FizzBuzz)
#40Talking about actually genial FizzBuzz interview answers, I have yet to see someone even going close to this: https://aphyr.com/posts/353-rewriting-the-technical-intervie...