Most big tech companies that I'm familiar with allow you to program on your free time, as long as you give them a heads up and it doesn't conflict with the company's products. E.g. working on a video game or contributing to open source.
Amazon was more aggressive (in my opinion) and much stricter than any other company I've ever worked at.
Edit: I researched a lot of the other tech companies. Here's Google's documentation, for example, which outlines an exception process: https://opensource.google.com/docs/iarc/