3 ms·
So if you're asked to do fizzbuzz in an interview, feel free to bring these things up. Just don't make it seem like you're looking for excuses not to write code
by jameshart 11y ago
So if you're asked to do fizzbuzz in an interview, feel free to bring these things up. Just don't make it seem like you're looking for excuses not to write code.
If you approach fizzbuzz by saying 'okay, so you want me to write a program that generates this sequence on demand - otherwise we could just precalculate all 100 values - so I'm going to assume that you want something parameterizable. How about we make it take a dictionary of factors that map to certain keywords, and we take { 3: "Fizz", 5: "Buzz" } as an initial testcase?' I'm going to go along with that, so long as the code you write actually works. I might walk you back from internationalizing the output, but points for mentioning it.
- TheLoneWolfling 11y agoThat better be an ordered map, there.
- brudgers 11y agoFizzBuzz suffers from the StackOverflow fastest fingers on the internet problem, it favors cursory poorly engineered solutions. By which I mean what is FizzBuzz supposed to do if IO blocks because stdout got redirected to a resource that's not available? When the code the interviewer wants to see has IO operations spaghettied throughout the business logic rather than separated as a concern, is the exercise selecting for people who are perfectly willing to do only what is asked rather than what is needed? How many lines of code would FizzBuzz really be if we were serious about it as Engineers?
- jameshart 11y agoSo.... you really are trying to avoid writing any code, then?
- brudgers 11y agoI wrote and published a FizzBuzz about a year and a half ago when applying to Hacker School. It's pass by reference available on Google. The technical thrust of my first comment largely reflects what I learned from the exercise. The IO and crosscutting concerns in my second comment are a reflection of more recent additions to my understanding of software systems and the exercise of rethinking FizzBuzz brought them to the surface. The simplicity of FizzBuzz's business logic should not be seen as indicative that our computer systems are suddenly likewise simplified. Odds are you're not hiring people to write strings to the console.