Amazon interview question

ml basic + sampling coding question