feature engineering in test and train sets (on combined data or separately on train and test)
The idea is to build features based on your training set. In a real-world application, all you will have is a training set to build and deploy a model, and that model will predict the test examples that the application needs. In this setting, it is not realistic to assume that you will have the test data to generate features, as you will already have your model delivered. So, the mechanism to generate the features can only be fed with training information.

About this: 


  What are the implications when the distribution of a categorical variable are different in train and test and what happens when they are similar?


The implications of having different distributions of the data in the training and test sets are very bad. Your learning algorithm will only learn about things that are on the training set, and for that reason, if your test set has a different distribution you should consider changing your training set. However, if they follow the same distribution, then your algorithms will generalize properly if you do things right.