Google FDE Onsite Interview | ₹95Lakhs CTC | Bombed the DSA Round!!

Posted
27 Oct 2026
5 reads

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 -

  1. First of all prioritize the fact that in your path you should never reach negative fuel at any point of time.
  2. Secondly prioritize visiting minimum number of stations in the path.
  3. 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)

  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:

    1. The fuel level must never become negative at any point.
    2. Minimize the number of refueling stations visited.
    3. 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.

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Google recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!