fzzbzz

FizzBuzz. That's It


License
BSD-3-Clause
Install
pip install fzzbzz==1.1

Documentation

fzzbzz: FizzBuzz. Just the Essentials.

This is a Python implementation of the classic programming interview question.

Example Usage

Walking in to your umpteenth tech startup interview in as many years, you pretty much know what to expect. You're led into a room where the two interviewers sit. The one on the left sports a bright polo, a slight fauxhawk, and the easy smile that screams "MBA". To his left is a 20ish guy whose dark unkempt hair spills haphazardly over a thread-bare Django-Con T-shirt. On the side wall looms the centerpiece of every interview nightmare: a whiteboard.

"Thanks for coming in today," MBA says. "Your level of... experience... is impressive." The pause implies the understanding that he was still in diapers when you wrote your first object hierarchy. MBA glances toward Django, who looks down at the papers in his lap.

"I noticed that you have a lot of experience with COBOL," Django says. "Have you used any modern languages, like, say, Python?" The two of them gaze at you expectantly.

"Yes, actually, I've been using it for side projects since about version 1.4. If you take a look at my GitHub profile you'll see..."

"Great!" MBA interjects. "We're mostly a Python shop here, so why don't we start with that." It's a statement more than a question. "Are you familiar with 'Fizz Buzz'?"

You nod.

MBA gestures toward the whiteboard. "Why don't you quickly show us FizzBuzz in Python, for say, the numbers 1 to 100?"

You stand up, walk to the wall, and grab the red marker from the tray, and deftly scribble the following:

$ pip install fzzbzz
$ python -c "import fzzbzz; fzzbzz(100)"

You step back triumphantly. MBA and Django look at each other. Django laughs nervously. "Nice one. But we really need to make sure that anyone we hire is a competent coder, so..."

"No," you interrupt. "What you really need is to make sure that you're hiring a competent developer, and a competent developer is someone who is intimately familiar with what free and open tools are available, and uses them effectively rather than re-inventing the wheel every time a new challenge comes up."

The smile has faded from MBA's face. "That's well and good, but we really want to see your coding chops. Can you implement FizzBuzz in Python for us?"

You look him in the eye for a moment, and without dropping his gaze reply, "I already did."

MBA and Django lean toward each other, whisper something, and then stand up. MBA extends his hand: "thank you for coming in today; unfortunately I don't think you're the right fit for this company. Best of luck."

They show you to the door, and you walk out onto the crowded sidewalk. Someday you'll have to learn when to swallow your pride and play the game, but at least you can walk home knowing you were correct. Also, who would want to work for that stupid company anyway?