Waymo interview question

How do you approach legacy code?