I have a question about laws and practices in the software industry, specifically. I am wondering whether there are any restrictions regarding whether it is possible to do freelance work or have a "hobby business" doing practically the same thing as a company you are employed by full time? I assume such a situation would be problematic if the employing company gains its competitive advantage from the inner workings of their products or services. On the other hand, when this isn't the case, I don't see this being much of a problem. I remember hearing somewhere that there are laws regarding this, but I cannot remember the source.
Are there any regulations for such situations, or are they solved with e.g. NDAs when necessary? I'm looking for a general perspective, but the laws of any specific country would be interesting as well.
Edit: Just to clarify, I'm not currently in this situation and I'm not planning on using anything belonging to a company to gain an advantage. Rather, I'm interested in knowing whether potential employment in a company would make me unable to continue with a personal project within the same field. I understand I'll have to investigate thoroughly and discuss it with them before getting myself in such a situation.