Artera (CA) interview question

Split a dataset into train/val sets, based on certain constraints set out by the classes.