[1] For example, if I sell you my business and agree to sign a non-compete that I won't then turn around immediately and compete with you, these non-compete agreements will generally be upheld.
[2] In most states, courts have latitude to decide on what counts as "unreasonable". For example, a non-compete for a janitor at a Fortune 500 company probably won't be upheld. An executive's non-compete at the same company probably will be. But there's a lot of gray area in-between.
Usually if there's a noncompete case, there is also a trade secret misappropriation claim at the same time. So unfortunately there is little chance that a complaint based on overly broad noncompete would just be dismissed as a matter of law in NY, regardless of how stupid the thing is.
International Business Machines Corp. v. Papermaster
https://en.wikipedia.org/wiki/International_Business_Machine...
This is as an employee of course.