Google FDE Onsite Interview | ₹95Lakhs CTC | Bombed the DSA Round!!
- Posted
- 27 Oct 2026
Summary
I attended a Google Front‑end Development Engineer onsite interview, failed the DSA round, and did not receive an offer.
How it went
You are given "N" cities. There are "M" roads - each of the "M" roads connects two different cities directly.
When you go by a car from city 'x' to city 'y' via any one of the "M" roads - it costs you 1kg of fuel.
Car starts from the 'source' city and goal of the car is to reach the 'destination' city. Initailly car have 'P' kgs of fuel. Some cities have re‑fueling stations in them - whenever you visit a city which has re‑fueling station in it - it is necessary to re‑fuel your car to exactly 'P' kgs again. You are allowed to visit the same road multiple times. If you visit a road for 5 times - then it is counted as 5 times in the final answer as well. Source city will never be a station.
Your task is to go from 'source' city to 'destination' city -
- First of all prioritize the fact that in your path you should never reach negative fuel at any point of time.
- Secondly prioritize visiting minimum number of stations in the path.
- Thirdly prioritize using minimum number of direct roads in your path.
Output {min_stations,min_roads} which you would have to go through to go from 'source' to 'destination' and if it is not possible to do - report that as well (as you might run out of fuel in the path).
Questions asked (1)
- 01
Minimum Stations and Roads Path with Fuel Constraints
Data Structures & Algorithms
You are given "N" cities and "M" bidirectional roads, each connecting two distinct cities. Traversing any road consumes 1kg of fuel. A car starts at a designated source city with an initial fuel capacity of P kilograms. Certain cities contain refueling stations; upon visiting such a city, the car's fuel is instantly refilled back to P kilograms. The source city never has a station. The car may traverse the same road multiple times, and each traversal counts separately.
The objective is to travel from the source city to a destination city while satisfying three priority criteria:
- The fuel level must never become negative at any point.
- Minimize the number of refueling stations visited.
- Subject to the above, minimize the total number of road traversals.
Output the pair
{min_stations, min_roads}representing the optimal counts, or indicate that reaching the destination is impossible under the fuel constraints.