My Experience With Amazon at DevDays

Prologue

I was at DevDays yesterday; and during my time there I frequented the Amazon booth.  The same Amazon that Steve Yegge worked at.  The same Amazon that has essentially revolutionized online shopping. The same Amazon that… Ok, I’ll stop drooling now.  Amazon == programmer mecca. It ranks right up there with Google, Microsoft, and Fog Creek Software.  If you’re a programmer you want to work at one of those places.  It’s the Ivy league of programming careers, and about as tough to get into.  I had a ‘conversation’ with Joel Spolsky via twitter recently, and if I remember correctly an interviewee had no less than 6 interviews to determine whether or not he was ‘good enough’ to work at Fog Creek software.  I imagine the distribution of failure would scare most people away.

Act I: Epic Failure

So I went up to the Amazon booth and checked out their trivia questions.  The first one had to do with a variation of the fizz-buzz problem, and I recognized it for what it was.  But I was nervous, and the big Amazon (not a pun) guy with a goatee (BAGWG) was staring at me, so I stammered out something like: Well the ++i would evaluate to one higher the first time through. I botched it because I was studying the trees and didn’t pay attention to the fact that the forest would burn to the ground.  The answer was that while the problem accounted for either fizz (4) or buzz (5), it logically did not account for what would happen if there was a multiple that happened to have both fizz and buzz as factors (like 20). 

One of the PHD students that was hanging out with Rick Schott and I solved it (both Rick and I concentrated on the trees); and the exchange itself was somewhat funny:

BAGWG (to me): So you think you know the answer?

Me: Well the ++i would cause it not to iterate through…

BAGWG (interrupting): Doesn’t matter; any other ideas?

PhD Student: It won’t print anything anytime a number is a factor of both 4 and 5.

BAGWG (Turns so his back is towards me and separating us from the PhD Student): Have you ever thought about working for Amazon?

Rick and I looked at each other and walked away, dejected.

Act II: Victory Strikes Back

A little later, still smarting from missing the obvious, I walked back to the table and saw they had listed a new problem.  Essentially it was a problem where you had x,y coordinates defined, and you had to figure out based on the code shown whether or not the rabbit would get the carrot.  The answer is that no, the Rabbit would not because the carrot was hidden beyond the bounds checked by the code. I explained as much to the PhD student and Rick (who were coming to the same conclusion), and they told me I was wrong. 

I was, because I had used the word bounds to describe ‘out of bounds‘ instead of physically located outside of the array, which it was not.  Knowing that I had the answer correct this time, and remembering to use the correct terminology lest I get interrupted, I went up to the Amazon booth and chatted with another gentleman from Amazon (trying feverishly to avoid BAGWG, he was intimidating), and he gave me a Ninja for getting the problem right and asked me if I ever considered working for Amazon.I swear the Ninja is Laughing at me

Have I ever considered working for Amazon?

OMGWTFBBQ PONIES!!!111!!!.

Of course I have. Who hasn’t?!?!?!

I didn’t say this to him, though — I just nodded and he proceeded to ask me if I knew anything about EC2. I was still high from hearing the first question, so I stammered a question out that made it sound like I’d never even heard of Amazon and then proceeded to bolt from the table out of horror for my brain shutting down right when I could have had a networking session with the hiring manager for Amazon EC2

I swear the recently-won ninja in Rick’s shirt pocket laughed at me.

Act III: The Return of Defeat

The final question of the day (I’m recalling from memory) was about biased coin flips.  Specifically, let’s say you had a boolean method that acted like a coin flip and returned true or false and did so so that it was evenly distributed.  How would you construct a replacement method so that it would generate true only 31.416% of the time.  My thoughts were that I could get close with the following hacky code that I wrote just to test it out quickly:

 

       static void Main(string[] args)
        {
            Dictionary<int, bool> Flips = new Dictionary<int, bool>();
            Flips = flipCoin();
            int TrueCount = 0;
            int FalseCount = 0;
            foreach (var item in Flips)
            {
                if (item.Value)
                {
                    TrueCount++;
                }
                else { FalseCount++; }
            }
            Console.WriteLine(“True : ” + TrueCount);
            Console.WriteLine(“False : ” + FalseCount);
            Console.Read();
        }

        private static Dictionary<int, bool> flipCoin()
        {
            Dictionary<int, bool> _Flips = new Dictionary<int, bool>();
            bool result;
            Random rand = new Random();

            for (int i = 0; i < 1000; i++)
            {
                result = rand.Next(2) == 0 ? true : false;
                if (result)
                {
                    result = rand.Next(2) == 0 ? true : false;
                    if (!(result))
                    {
                        result = rand.Next(2) == 0 ? true : false;
                    }
                }
                _Flips.Add(i, result);
            }
            return _Flips;
        }

But that returns True about 33% of the time, give or take, so I knew this solution wasn’t correct.  I kept thinking about the Monty Hall problem and thought maybe that was related somehow, but I couldn’t figure out how.  I figured I could try a naive implementation of Rand() by keeping a ratio of true/false so that over a series of rolls, the probability would end up being 31.416%; but I also knew instinctively that that was wrong. What’s funny is that when it comes to matters of probability, lots of people get it wrong, including Blaise Pascal.

Something the BAGWG said to another passer by is still bouncing around in my head: It’s an easy one-line change.

I have no idea what that one-line change is; but I will figure it out.  It’s probably something really easy; something that once someone tells you you realize the piece you were missing.  It is driving me nuts because I know I should be smart enough to know the answer, and I don’t — and that bugs me.

Epilogue

But there is a chance!

I’ve been staring at the Amazon business card they gave me; both because I want to go download a barcode library and decode the barcode on it, and also because I really really want to submit my resume.

There are lots of reasons why I shouldn’t:

  • I can’t even figure out a simple probability problem
  • I’m just now learning Emacs
  • I’ve never even written a compiler
  • I’ve never used pointers in a production application

Reasons I should:

  • Not trying is much worse than trying and failing
  • Between ‘slim’ and ‘none’, I’ll take slim any day
  • Because that’s what I’d tell other people to do

To Be Continued…

 


Note to any employer (present or future): If I work for you, it’s because:

  • I like the work.
  • I like what I do.
  • I like where I work.
  • I like the people.
  • I like bullet points.

However, if Amazon or Google or Fog Creek Software or any other company that was universally recognized as a great place to work as a programmer contacted me and subsequently offered me a job, I’d probably put in my notice and leave.

It’s nothing personal.

Why would I leave? It’d probably have to do with the Joel test.  It’s the Ladder Theory for programming: we’re always going to go to the place that scores the highest on that test. One way to  keep good programmers is to score very highly on the Joel Test, the other is to hand out Porsches. I think the former is less costly for you.

Leave a Reply