Bloomberg Coding Interview: Road Trip Between Two Points
Based on a candidate's reported Bloomberg interview
The interviewer opens
Hi, and thanks for joining; welcome to your interview for the Senior Software Engineer role at Bloomberg. We'll work through one coding problem together, and I'd like you to think out loud as you code. If you need to step out or take a break, you can pause the interview any time with the Pause button at the top right of your screen.
The problem is about planning a road trip with refueling stops, and it's up in the Problem tab now. Please read it through, take your time, and ask me any questions before you start.
The problem
A car must drive from a start point to an end point on a city grid, refueling at gas stations along the way.
start,end: points{x, y}with integer coordinates.stations: list of gas-station points.max_range: the distance the car can drive on a full tank.
Distance between two points is |x1 - x2| + |y1 - y2|. The car starts with a full tank, drives straight from point to point, and each station refills it to full. A leg is possible if its distance is at most max_range. Return true if the car can reach end, otherwise false.
Example: start (0,0), end (10,0), stations [(4,0),(7,1)], max_range 5 → true
Up to 1,000 stations.