Q:

Can a company apply for a patent after they release the product?

I know that prior art deems that a patent application should be denied.  However, what is the specific chain of events for a company that wants to release a product asap.
Can they release product at application time?  Must they wait until grant time?  Can they have released the product before the patent application? 

A:

Anywhere, it is enough to have filed an application. A patent is not granted if the known technology at the filing date makes the invention obvious or not novel.
What happens afterwards doesn't matter for that specific patents. It does matter for following patents of improvements for example because bringing a product to market counts as publishing it.
There is a grace period in the US and some more places (not EU or other big countries though!) Which gives you some time to file after your own publication. Don't use that if you want your patent anywhere outside the US because it even impedes a PCT application originating from the US one.

