X interview question

A basic coding exercise and a basic machine learning exercise.