BlackBerry interview question

Code a popular machine learning algorithm from scratch.