Sunday, January 03, 2021

Advent of Code vs. FizzBuzz

A bunch of coding types at the Strain Factory participated in The Advent of Code, a clever 24-day set of programming challenges that runs each year before Christmas.  Each day a new two=part programming challenge was posted.  Technically it is a speed contest, but you won't find me on the public leaderboard as I'm not nearly quick enough to ever rate a point there.  One of my  major official activities last month was contributing towards screening candidates for three different computational positions, one of which we threw open to general data science experience.  As a result, I've been thinking far too much about the FizzBuzz problem and my prejudices towards it.

 FizzBuzz is a simple numerical challenge that apparently is used sometimes to introduce students to factoring integers.  In the human form, a circle of people rotates the duty of naming the next integer in series -- except for numbers which have some integer as a factor one says "fizz" instead and for another rule one says "buzz".  It also ends up being an early coding problem, and you can find solutions in every imaginable programming language.

The only reason I bring this up is many job applicants for computational positions have their GitHub on their CV, so the HR system we use pops that out as a nice hyperlink.  I quite literally read over 200 resumes in 2020, which presents a challenge between culling them quickly enough to stay sane but ensuring that worthy candidates aren't dropped too early.  One candidate made this easy by sending their phone bill instead of a resume, but most required careful thought.  When you do this, you start noticing trends and outliers in resume design.  You balance skimming for keywords vs. trying to read each description carefully.  Once a resume has made it past a number of filters, browsing around their GitHub site starts sounding like a good idea.  And that's how I hit the GitHub with just FizzBuzz.

Maybe it had one more project, but the thing that caught my eye was FizzBuzz.  And I'll be upfront: I don't find FizzBuzz and interesting programming problem.  There are multiple variations on FizzBuzz, but all the ones I've seen just layer on more rules.  So it ends up just being iterate over integers and then apply some set of if-then-else to decide which signal to emit.  In particular, I've decided I can justify my prejudice in that there is no need to think about data structures.  There's no way to make fizzbuzz exponentially harder.

Some of the Advent of Code problems had a nasty hook on the second half, often making me regret hacking an ugly brute force solution to the first part.  One thing I liked about the problems is that there were often different algorithmic approaches, and if I felt energetic I could go back and re-code my solutions by a different approach -- or try making more compact code or use paradigm X or so forth.  Or think about coding a logical recursion without explicit recursion.  Or change the data structures I was using. One solution touched on a math theorem I wish I reflexively knew; another was best solved by ignoring some famous advice from Bjarne Stroustrup.  Conway's Game of Life showed up twice, and there were other cellular automata problems. Those are all the things missing from FizzBuzz

I suspect I also don't like FizzBuzz because I encountered it only in adult life, long after needing such simple problems.  So I have no sentimental attachment.  Code up Wumpus -- which actually is computationally more complex than FizzBuzz -- and I will love it.  Show me an array of different sorting methods and I will feel a resonance  as that was how I was first introduced to thinking about memory and space requirements of an algorithm as well as thinking about worst case inputs.

Not that my own GitHub is particularly interesting, though one piece of code I could imagine working into a problem for Advent if I were in that business (it generates compact sequences ).   But I have the luxury of a track record.  The one position I wrote to try to be entry level, which meant we got (and advanced) a number of candidates with minimal industry experience.  

If you are in that spot, I'd definitely suggest you look at your GitHub and think about what impression it make on a curmudgeon such as myself.  Working a bunch of Advent of Code problems -- particularly by working and re-working them == could be a good way to add heft to your repository.  Plus it could be a good conversation starter for an interview situation -- "I tried coding this alternately as depth first and breadth first searches, and even figured out how to code both forms as one bit of code".  Or, "I had never thought about Conway's Life in higher dimensions than 2 -- it was very interesting!".  Taking on a sequence dataset like I did yesterday would be good too.  But a repository with just FizzBuzz isn't likely to be a conversation  starter or conversation extender -- there just isn't much to say about that problem.

No comments:

Post a Comment