Thursday, August 26, 2010

Amazon Web Developer Interview

There are a lot of things to talk about to test technical skills in an Rails web developer interview. There are many Rails topics that could be covered - just to name a few, topics could include Routes, Migrations, Testing, Fixtures, Gems/Plugins, Authentication, 3rd Party Tools and services, Named Scopes, Rails 3.0. Nested Attributes, Observers, Counter caches, Tagging, Delayed Worker Jobs, Email.

The nice thing about Rails, as it is open source and quite elegantly architected, it's easy to also discuss common web design patterns at a higher level - like REST, Model View Controller (MVC), Authentication, DB performance, Querying strategies, Caching strategies, etc. without talking about Rails specifically.

I interviewed with Amazon recently - it was a phone interview for a Senior Ruby on Rails Developer. I talked with one of the members of the team that uses Ruby on Rails for their app. Rails at Amazon is pretty rare and I was intrigued.

The phone interviewer had two questions for me. The questions weren't about Web Development or Ruby on Rails, but I expected that. Amazon is known to be consistent with their technical interviews - they ask about big O notation, memory usage, performance, etc. Here's what we talked about in my interview.

Implement a Fibonacci method so f(0) = 0, f(1) = 1, and f(n) = f(n-1) + f(n-2)

def f(n)
n <= 1 ? n : f(n-1) + f(n-2)

def f(n)
a = 0; b = 1
n.times { a, b = b, (a + b) }
return a

After the methods were written and I sent them to the interviewer by email, we discussed the Order (big O notation) of the methods. The order of the second Fibonacci method is linear the first method's order is exponential.

We then had a discussion about the following...

Given an array of integers, return all integers in a particular range.

Web developers hardly ever write algorithms like these in their daily work and the questions may seem unrelated or outdated. If you did write a method like this, you'd want it to be readable and maintainable for other developers and could give a little on performance and memory. We discussed the performance issues and memory usage for these methods. In practice, performance issues for a web application are often due to slow queries or slow web pages and multiple requests to the server.

Keep in mind - Amazon technical interviews are not meant to gather your practical experience for the job, they are intended to test your CS fundamentals and the questions provide a standard that all interviewees can be measured against. Amazon is comparing apples to apples this way, even if they aren't necessarily the skills you'd use on the job.

If you pass the technical phone interview, you will be invited in for a longer set of interviews, and those tend to cover job related skills.

If you are interviewing at Amazon, I recommend you look over the Amazon interview questions posted on Glassdoor. They have many examples that will give you a good idea of the questions and how to answer them.

Tuesday, August 03, 2010

Permission denied for to call method Location.toString on

I keep getting these javascript errors -

Permission denied for to call method Location.toString on

GM80 is not defined

They show up in firebug, and appear to be due to google analytics. Looking on Google, I see nothing - surprisingly, the phrase "GM80 is not defined" is not even indexed (as of today - update, it took Google just a few minutes for this post to be indexed), but it's hard to believe no one else runs into this.

It doesn't seem to cause any real problems, just throws errors once in a while.