Query on the session timed 14:20

Quick query on the Lesson 3 where it is said that we need to split the data set into test and train dataset before handling missing values and handling categorical variables , just asking whether we should do the other way around ?