← Google Interview Insights

Google·Software Engineer·Onsite - Multi Round·Intermediate

IntermediateRejected
Aug 2026

Summary

Went through Google's hiring process for a software engineering role, four rounds total: one behavioral/culture fit and three coding. Felt pretty solid coming out of the coding sessions but got rejected anyway, which is still messing with my head.

Questions Asked (2)

Q1

Given a grid with blocked nodes, find the shortest path from a source to a destination without passing through any blocked nodes.

Algorithms & Data Structures
Author's notes

Went with BFS, which felt like the right call.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the grid as a graph where each cell is a node and edges connect adjacent non-blocked cells. Use BFS to find the shortest path in terms of number of steps, since all edges have equal weight. If movement costs vary, use Dijkstra's algorithm with a priority queue.

Pro tip: Clarify with the interviewer whether diagonal moves are allowed and whether the grid has uniform movement costs. Mentioning edge cases like unreachable destination or empty grid shows thoroughness.

1. Clarify problem constraints

Ask about grid size, movement directions (4-way or 8-way), and whether all moves have equal cost. Confirm if the destination is guaranteed reachable.

2. Choose the right algorithm

For unweighted grids, BFS is optimal. For weighted grids, use Dijkstra's algorithm. Mention A* if heuristic is available.

3. Implement BFS/Dijkstra

Use a queue for BFS or a priority queue for Dijkstra. Track visited cells to avoid cycles and store parent pointers to reconstruct the path.

4. Handle edge cases

Check if source or destination is blocked, if the grid is empty, or if no path exists. Return -1 or appropriate indicator.

5. Analyze complexity

For BFS, time complexity is O(V+E) = O(mn) for an m x n grid. Space complexity is O(mn) for the queue and visited set.

Key Points to Mention

  • BFS guarantees shortest path in unweighted graphs
  • Use a queue for BFS and a priority queue for Dijkstra
  • Track visited nodes to avoid infinite loops
  • Reconstruct path using parent pointers
  • Time and space complexity analysis
  • Edge cases: blocked source/destination, no path, empty grid

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Follow-up: find the path from source to destination that passes through the fewest blocked nodes, and return that minimum count.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This is where it got interesting.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the problem as a shortest path on a graph where each node has a cost of 1 if blocked and 0 otherwise. Use 0-1 BFS with a deque to find the path from source to destination that minimizes the total cost, which is the number of blocked nodes traversed. Return the minimum cost.

Pro tip: Mention that 0-1 BFS is optimal for binary edge weights and runs in O(V+E), which is more efficient than Dijkstra with a priority queue. Also, clarify that if blocked nodes cannot be traversed at all, the problem changes to finding a path avoiding them entirely, which is a different problem.

1. Clarify the problem

Confirm whether blocked nodes can be traversed (with a cost) or must be avoided. Also check if the graph is weighted or unweighted, directed or undirected, and if there are any constraints on the path length.

2. Model as a graph with costs

Assign a cost of 1 to edges entering blocked nodes and 0 to edges entering unblocked nodes. This transforms the problem into finding a path with minimum total cost.

3. Choose the right algorithm

Since edge weights are 0 or 1, use 0-1 BFS with a deque: push 0-weight edges to the front and 1-weight edges to the back. This finds the shortest path in O(V+E) time.

4. Implement and track the cost

Maintain a distance array initialized to infinity, set distance[source] = 0, and update distances as you traverse. Return distance[destination] as the minimum number of blocked nodes.

5. Analyze complexity and edge cases

Discuss time and space complexity (O(V+E) time, O(V) space). Handle edge cases like source equals destination, no path exists, or multiple paths with the same cost.

Key Points to Mention

  • 0-1 BFS algorithm and its O(V+E) time complexity
  • Graph modeling with node costs converted to edge weights
  • Deque usage: push front for 0-cost edges, push back for 1-cost edges
  • Comparison with Dijkstra's algorithm and why 0-1 BFS is more efficient here
  • Handling of blocked nodes: whether they can be traversed at all
  • Edge cases: source equals destination, unreachable destination, and multiple optimal paths

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.