I have worked at Amazon.com and I currently work at Google. The Google policies are much, much better than Amazon's, both in letter and in practice.

The Google policy is not, as this article/discussion implies, a blanket policy where everything you do on your own time belongs to Google. From my employment agreement:

"I understand that the provisions of this Agreement requiring assignment of Inventions to the Company do not apply to any invention which qualifies fully under the provisions of California Labor Code Section 2870 (attached hereto as Exhibit B). I will advise the Company promptly in writing of any inventions that I believe meet the criteria in California Labor Code Section 2870 and not otherwise disclosed on Exhibit A."

You can see the contents of California Labor Code Section 2870 here. It says the essence of what your Amazon agreement says; stuff you develop entirely on your own time and does not compete with the company belongs to you.
http://www.leginfo.ca.gov/cgi-bin/displaycode?section=lab...

So far, the two companies sound the same. But the internal policies surrounding this are worlds apart.

At Google, there is a fairly liberal policy around open-sourcing of code that belongs to Google. So code that you work on internally or on 20% time can be open-sourced without much push-back. In my experience, the policy is so favorable to open-sourcing that the primary barriers are technical (disentangling internal code from internal-only dependencies) rather than legal/policy. From this policy we see tons of Google open-source releases, like Protocol Buffers and tcmalloc.

Amazon also has an open-source releasing process. But the culture is so suspicious of open-sourcing that a friend of mine spent literally FIVE YEARS getting a project of his approved for open source release. I am not exaggerating. This is a project he is passionate about and has been working on for that entire time. The project is not proprietary in any way; it's a set of UNIX utilities for piping data around in JSON format instead of flat text, and he (and a community inside Amazon) wrote a bunch of useful transformations that made it like UNIX on steroids. Clearly not software that competes with Amazon.

Then there is the question of working on non-open-source software on your own time, because (for example) you're trying to do some business on the side. Now if you can show that your side project does not compete with Google according to the California statute above, then you're legally protected and it belongs to you. But ideally you want to avoid going to court at all. What you want is an assurance from Google that it won't attempt to claim ownership of your work. So there is a process called the IARC (Invention Assignment Review Committee) where you can submit a description of your work, and if your submission is accepted, you get an assurance from Google that it won't try to claim ownership of it.

This is a strict improvement over the Amazon situation, because you have the same legal protections you had already, but additionally you can preemptively clear the rights to any work you're doing on the side.

So in my view, Google has some of the best policies related to open sourcing of any company I've ever worked at, and certainly better than Amazon's.