Google | Round-1 | L-3 | Hyderabad/ Bangalore

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2025-11-07Added By Anonymous
Source: Link

Company: Google
Role: L3
Interview Stage: Phone Screen
Location: Hyderabad/ Bangalore
Year: unknown

Original Post Content:

Recently had the Round-1 for L-3 role, got asked this same question from feb'25 round-1:

Round 1- Given are N cities and M roads that travel between the given pair of cities and time it takes to travel that road. Also we are given a list of favourite cities L and a source city S. We have to tell the favourite city which can be reached from source city the fastest (in minimum time).

Solution- Classic Dijkstra Algo. Started discussion with BFS, DFS approaches and then had some time on Time Complexity for various cases, it was O((V+E) log(V)). This went on for a while, since we had a little argument about the complexity of the inner loop.

Then a follow up -
1) A fix vertex V to be travelled in the way to favourite city. I made a wrapper function which calls Dijkstra to find dist S-V + Dijkstra to find V-C (favourite city).

Gotta say hands down to @leethard for this goldmine of a list:
https://leetcode.com/discuss/post/6185127/2024-google-interview-questions-compilat-mjrf/

Looking forward to Round-1's result.

Comments