Actually, technically, StackExchange is not profitable yet: (http://www.joelonsoftware.com/items/2015/01/20.html). However, "We could just slow down our insane hiring pace and get profitable right now, but it would mean foregoing some of the investments that let us help more developers."
Look at Reddit, they have very few employees yet they can't make a profit because their hosting costs are massive.
Contrast them with StackExchange, which uses a small number of powerful, well-optimized servers and is very profitable.