← Google Interview Insights

Google·Software Engineer·Onsite - Multi Round·Intermediate

IntermediateRejected
Jul 2026Warsaw

Summary

Interviewed for a software engineering role at Google's Warsaw office, four rounds total: two remote and two in-person. Passed the first two but got knocked out by a dynamic programming problem in the onsites, which put me on a year-long cooldown. The experience was a reality check about how little Google cares about anything except whether you can produce an optimal solution under pressure.

Questions Asked (5)

Q1

Given a 2D grid, search for a target word by traversing adjacent cells using depth-first search.

Algorithms & Data Structures
Author's notes

Solved it, but missed a space optimization that I only realized after the fact.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem constraints (e.g., grid size, word length, allowed moves) and then describe a DFS backtracking solution that explores all four directions from each cell, marking visited cells to avoid reuse. Analyze time and space complexity, and discuss potential optimizations like pruning or early termination.

Pro tip: Mention that you can optimize by checking character frequency or using a trie if multiple words are involved, and always discuss trade-offs between DFS and BFS for this problem.

1. Clarify the problem

Ask about grid dimensions, word length, allowed moves (4-directional or 8-directional), and whether cells can be revisited. Confirm if the word must be formed by a simple path.

2. Outline DFS approach

Explain that you will iterate over each cell as a starting point and perform DFS to match the target word character by character. Use a visited set or modify the grid in-place to avoid revisiting cells.

3. Detail backtracking and base cases

Describe the recursive function: if the current character matches, mark the cell as visited, recurse in all four directions, then unmark. Base cases: if index equals word length, return true; if out of bounds or character mismatch, return false.

4. Analyze complexity

State that time complexity is O(N * 3^L) where N is number of cells and L is word length, as each step branches to at most 3 directions (excluding the one we came from). Space complexity is O(L) for recursion stack.

5. Discuss optimizations and edge cases

Mention pruning: if the first character doesn't match, skip; if word length exceeds grid cells, return false. Also discuss handling empty grid or empty word.

Key Points to Mention

  • Depth-first search with backtracking
  • Visited cell tracking (in-place modification or boolean array)
  • Recursive function structure and base cases
  • Time and space complexity analysis
  • Edge cases: empty grid, empty word, word longer than grid cells
  • Optimizations: early termination, character frequency check, trie for multiple words

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

Q2

Given a set of coin denominations and a target amount, find the number of distinct combinations that sum to that target.

Algorithms & Data Structures
Author's notes

This one ended me.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem: whether order matters (combinations vs permutations) and if coins can be reused (unbounded knapsack). Then propose a dynamic programming solution where dp[i] represents the number of ways to make amount i, iterating over coins in the outer loop to avoid counting permutations.

Pro tip: Mention that iterating coins in the outer loop and amounts in the inner loop ensures each combination is counted once, whereas the reverse order counts permutations. This subtlety often trips up candidates and showing awareness demonstrates deep understanding.

1. Clarify the problem

Ask if order matters (combinations vs permutations) and if coins can be reused unlimited times. Confirm that we need distinct combinations, not permutations.

2. Define the DP state

Let dp[i] be the number of ways to make amount i using the given coin denominations. Initialize dp[0] = 1 (one way to make amount 0: use no coins).

3. Determine iteration order

Iterate over each coin in the outer loop, and for each coin, iterate over amounts from coin to target in the inner loop. This ensures combinations are counted once.

4. Implement the recurrence

For each coin, update dp[amount] += dp[amount - coin]. This accumulates the number of ways to form each amount using the current coin and previously processed coins.

5. Analyze complexity and edge cases

Time complexity is O(n * target) where n is number of coins, space O(target). Discuss edge cases: target=0, no coins, unreachable amounts, and large target requiring optimization.

Key Points to Mention

  • Dynamic programming approach with 1D array
  • Difference between combinations and permutations
  • Importance of loop order (coins outer, amounts inner)
  • Time and space complexity analysis
  • Handling edge cases like target=0 or empty coin set
  • Potential optimization for large target (e.g., using only reachable amounts)

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

Q3

Given the previous coin change problem, can you reverse the problem: given a number of combinations, reconstruct a valid set of coin denominations?

Algorithms & Data Structures
Author's notes

Never got to this.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the problem: given a target number of combinations, find a set of coin denominations that yields exactly that many combinations for some amount (or for all amounts up to a limit). Then, reason about the relationship between denominations and combination counts, and propose a constructive algorithm or reduction to a known problem.

Pro tip: This is an inverse problem, so start by identifying invariants or simple cases (e.g., using only 1s) and then show how adding a new denomination multiplies the number of combinations. Demonstrating that you can reduce the problem to a known NP-hard problem (like subset sum) or provide a constructive solution for special cases will impress the interviewer.

1. Clarify the problem

Ask whether the target number of combinations is for a specific amount or for all amounts up to a limit, and whether denominations must be positive integers. Confirm if the coin change problem is the standard one (order doesn't matter).

2. Analyze simple cases

Start with trivial solutions: e.g., using only denomination 1 gives exactly 1 combination for any amount. Adding a denomination d increases combinations in a predictable way. Derive formulas for small sets.

3. Identify constraints and complexity

Determine if the problem is always solvable. For arbitrary target counts, it may be NP-hard (related to subset sum or integer factorization). Discuss whether a constructive solution exists for all inputs or only special cases.

4. Propose an algorithm

For special cases (e.g., target is a power of 2), give a constructive method. For general case, suggest a search/backtracking approach or reduction to known problems. Mention dynamic programming for verification.

5. Test and verify

Walk through an example: given target combinations = 4, find denominations. Show how your algorithm produces a valid set (e.g., {1,2} gives 3 combinations for amount 3? Actually need to compute). Verify by running the standard coin change DP.

Key Points to Mention

  • The inverse problem is not uniquely determined: multiple denomination sets can yield the same number of combinations.
  • The number of combinations for a given amount with a set of denominations can be computed via dynamic programming (order doesn't matter).
  • Adding a new denomination d to a set multiplies the number of combinations in a structured way, often leading to exponential growth.
  • The problem may be NP-hard for arbitrary targets, as it relates to subset sum or integer factorization.
  • Constructive solutions exist for special targets (e.g., powers of 2, factorials) by using denominations that are powers of a base.
  • Always verify the reconstructed set by running the coin change algorithm to ensure the combination count matches the target.

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

Q4

Partition an array into subarrays satisfying a given condition, using prefix sums to optimize the solution.

Algorithms & Data Structures
Author's notes

Went better.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the exact partitioning condition and constraints, then explain how prefix sums can reduce the time complexity from O(n^2) to O(n) or O(n log n). Walk through a concrete example and derive the recurrence or greedy strategy, emphasizing the role of prefix sums in enabling O(1) subarray sum queries.

Pro tip: After presenting the optimal solution, mention how you would handle edge cases like negative numbers or large inputs, and discuss potential follow-ups such as using a hash map to count valid partitions or extending to circular arrays.

1. Clarify the problem

Ask questions to confirm the partitioning condition (e.g., each subarray sum ≤ K, or equal sums) and constraints (array size, element range, negative numbers allowed).

2. Define prefix sums

Explain that prefix sums allow O(1) computation of any subarray sum: sum(i, j) = prefix[j] - prefix[i-1].

3. Derive the algorithm

Use prefix sums to efficiently check the condition for each possible partition point, either greedily or with dynamic programming, and analyze time/space complexity.

4. Walk through an example

Trace the algorithm on a small array to demonstrate correctness and show how prefix sums simplify the process.

5. Discuss optimizations and edge cases

Mention how to handle negative numbers, large inputs, and potential follow-ups like counting all valid partitions or minimizing the number of subarrays.

Key Points to Mention

  • Definition and precomputation of prefix sums
  • Time complexity improvement from O(n^2) to O(n) or O(n log n)
  • Handling negative numbers and zero-sum subarrays
  • Greedy vs. dynamic programming approaches for partitioning
  • Space complexity trade-offs (e.g., using a hash map for prefix sums)
  • Edge cases: empty array, single element, all elements satisfying condition

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

Q5

Behavioral questions covering past work situations, including at least one hypothetical scenario about how you'd handle a specific challenge.

Adaptability & AmbiguityStakeholder Management
Author's notes

Had my stories ready and structured as situation-action-result, so this was fine.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Use the STAR method to structure your behavioral answers, ensuring you highlight the situation, task, action, and result. For the hypothetical scenario, apply a similar framework by describing how you would approach the challenge step-by-step, emphasizing adaptability and stakeholder management. Tailor your responses to Google's values, such as innovation, collaboration, and user focus.

Pro tip: Demonstrate self-awareness by briefly reflecting on what you learned from past experiences and how you would apply those lessons to the hypothetical scenario. This shows growth and maturity.

1. Understand the Question

Listen carefully to identify whether it's a past experience or hypothetical scenario. For past experiences, recall a specific example; for hypotheticals, outline a clear approach.

2. Structure with STAR

For behavioral questions, use STAR: describe the Situation, Task, Action, and Result. For hypotheticals, adapt to describe the Situation, Task, Approach, and expected Result.

3. Highlight Adaptability & Stakeholder Management

Emphasize how you remained flexible, learned quickly, and managed relationships with stakeholders like product managers, designers, or clients.

4. Quantify and Reflect

Include measurable outcomes (e.g., reduced latency by 20%) and reflect on lessons learned or how you would improve next time.

5. Connect to Google

Tie your answer to Google's culture, such as innovation, scalability, or user-centricity, showing alignment with the company's values.

Key Points to Mention

  • Specific examples of adapting to changing requirements or ambiguous situations
  • Techniques for managing stakeholders with conflicting priorities (e.g., regular syncs, clear communication)
  • Use of data or metrics to inform decisions and measure success
  • Collaboration with cross-functional teams (e.g., PM, UX, SRE)
  • Lessons learned from failures or challenges and how you applied them
  • Proactive steps you would take in a hypothetical scenario to mitigate risks

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