If you work for a major tech company like Microsoft or Google, do you have to sign a non-competitive contract (I'm pretty sure the answer is yes, but) what are the usual conditions? Are you able to work for another company after X years?

I just feel like singing such a contract might lead to a very unhappy life. What if I don't like working at Microsoft but would love it at Google?