As reported: Visa SDE 1 (US) online assessment on CodeSignal (2025; proctored, 70 minutes, 4 questions), question 2 — medium/hard: the same problem as LeetCode Minimum Number of Refueling Stops.
A car starts at position 0 with startFuel liters and must reach position target. It uses one liter per mile. stations[i] = [position_i, fuel_i] is a station position_i miles from the start with fuel_i liters; stopping there takes all of its fuel. The tank is unlimited. Return the minimum number of stops needed to reach target, or -1 if it cannot be reached. Arriving at a station or at the target with 0 fuel left still counts as arriving.
This is LeetCode 871 — Minimum Number of Refueling Stops.
Example
target = 1, startFuel = 1, stations = [] -> 0
target = 100, startFuel = 1, stations = [[10,100]] -> -1
target = 100, startFuel = 10, stations = [[10,60],[20,30],[30,30],[60,40]] -> 2
Constraints: 1 ≤ target, startFuel ≤ 10^9; 0 ≤ stations.length ≤ 500; 1 ≤ position_i < position_{i+1} < target; 1 ≤ fuel_i < 10^9.
Code runner format: one JSON value per line: target, startFuel, stations. Implement minRefuelStops(target, startFuel, stations); the harness prints the number.