← Google Interview Insights

Google·Software Engineer·Onsite - Multi Round·Intermediate

IntermediatePass
Feb 2026Warsaw

Summary

Passed the hiring committee loop for a Software Engineer role at Google in Warsaw after a previous failed attempt. The process included an online assessment with a grid pathfinding problem plus an HR screen, followed by an onsite with two sweeping line algorithm rounds. Prep was mostly Neetcode, Claude, and scraped Leetcode problems, with heavier focus on advanced algorithms the second time around.

Questions Asked (2)

Q1

Count the number of unique paths in a grid from one corner to the opposite corner, where you can move left, up, or down.

Algorithms & Data Structures
Author's notes

The non-standard move set tripped me up a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the movement rules and grid dimensions, then model the problem as counting paths in a directed graph or using dynamic programming. Recognize that the ability to move left, up, and down introduces cycles, so a naive DP fails; instead, consider that the problem may be equivalent to counting simple paths, which is #P-complete in general, and discuss constraints or alternative interpretations.

Pro tip: Interviewers often expect you to identify that allowing left, up, and down makes the problem significantly harder (likely #P-complete) and to discuss how the answer changes if moves are restricted to right and up. Demonstrating this awareness shows depth and prevents you from diving into an incorrect solution.

1. Clarify the problem

Ask about grid size, starting and ending corners, and whether paths can revisit cells. Confirm that moves are left, up, and down (no right), which creates cycles.

2. Identify the complexity

Explain that with cycles, counting simple paths is #P-complete, so no polynomial-time algorithm exists unless P=NP. Mention that if moves were only right and up, the answer would be a simple binomial coefficient.

3. Propose approaches for small grids

For small grids, suggest backtracking with memoization on visited cells (bitmask DP) or DFS with pruning. Discuss time complexity O(2^(m*n)) and space O(m*n).

4. Discuss alternative interpretations

If the interviewer intended only right and up moves, present the combinatorial solution: C(m+n-2, m-1). If only up and down, the answer is 1 (straight line).

5. Summarize and conclude

Restate that the problem as stated is computationally intractable for large grids, and offer to implement a solution for small grids or under different movement constraints.

Key Points to Mention

  • The problem is #P-complete when cycles are allowed, as it reduces to counting simple paths in a directed graph.
  • Dynamic programming works only for acyclic movement (e.g., right and up), yielding a binomial coefficient solution.
  • For small grids, use DFS with backtracking and memoization (bitmask DP) to count simple paths.
  • Clarify whether revisiting cells is allowed; if not, it's simple paths; if yes, it's infinite due to cycles.
  • Mention the time complexity: exponential for general case, polynomial for acyclic case.
  • Discuss how the answer changes if moves are restricted to right and up: C(m+n-2, m-1).

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

Q2

Two separate algorithm problems involving a sweeping line approach, asked during the onsite rounds.

Algorithms & Data Structures
Author's notes

Both came up in the onsite.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

For each problem, first clarify the input/output and constraints, then identify the need for a sweep line by recognizing events (e.g., start/end points) that can be sorted and processed in order. Explain how to maintain state (e.g., active intervals, current overlap count) as you sweep, and analyze time/space complexity. Practice communicating the algorithm clearly and handling edge cases.

Pro tip: Demonstrate deep understanding by discussing how to handle duplicate coordinates and whether to process starts before ends (or vice versa) based on the problem's definition of overlap. Also, mention that sweep line is often combined with a data structure like a heap or balanced BST for dynamic updates.

1. Clarify the problem

Ask questions to confirm input format, output requirements, constraints, and edge cases (e.g., empty input, single interval, duplicate points).

2. Identify sweep line applicability

Determine if the problem involves intervals, points, or events that can be sorted along an axis, and if a running state can be maintained efficiently.

3. Define events and sorting order

Specify what constitutes an event (e.g., interval start/end) and how to sort them (e.g., by coordinate, with tie-breaking rules).

4. Design state maintenance

Choose an appropriate data structure (e.g., counter, heap, BST) to track active intervals or relevant information as the sweep progresses.

5. Analyze complexity and test

Derive time and space complexity, then walk through examples and edge cases to verify correctness.

Key Points to Mention

  • Event-based processing: converting intervals into start and end events.
  • Sorting events by coordinate, with careful tie-breaking (e.g., process starts before ends for maximum overlap).
  • Maintaining a running count or using a priority queue to track active intervals.
  • Time complexity: O(n log n) due to sorting, and O(n) for the sweep.
  • Space complexity: O(n) for storing events or active intervals.
  • Handling edge cases: empty input, single interval, intervals with same start/end, and large input sizes.

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