ORMAE interview question

Coding questions, Machine Learning algorithm pseudo answer