Apple interview question

Make an interpolation function