Waymo interview question

code out a mathematical procedure