Netflix interview question

Code the decision tree from scratch with Gini index.