Amazon interview question

How would you solve ML question X?