← Google Interview Insights

Google·Software Engineer·Onsite - Multi Round·Intermediate

IntermediatePending
Jun 2026

Summary

Went through the full Google loop for a software engineering role, split across two separate rounds about five months apart. The first batch was virtual, the second onsite. Four technical rounds total plus a behavioral one, and my self-ratings ranged from solid to pretty good across the board, though I'm still not sure what the outcome will be.

Questions Asked (4)

Q1

Given a binary search tree, find the longest path where all nodes share the same value.

Algorithms & Data Structures
Author's notes

Virtual round, first technical question.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem definition first, then propose a recursive DFS solution that computes the longest same-value path in the left and right subtrees and combines them if the current node's value matches its children. Analyze time and space complexity, and discuss edge cases and potential optimizations.

Pro tip: Explicitly state your assumptions about what constitutes a 'path' (e.g., must it be a simple path? can it go through the root?) and confirm with the interviewer before coding. This shows attention to detail and avoids wasted effort.

1. Clarify the problem

Ask questions to define 'path' (e.g., can it go up and down? must it be contiguous? can it include nodes with different values?) and confirm the expected return type (length in nodes or edges).

2. Outline a recursive approach

Explain that you'll use DFS to compute, for each node, the longest same-value path in its left and right subtrees, and then combine them if the node's value matches its children's values.

3. Define the recursive function

Define a helper function that returns the longest same-value path starting from the current node and going down. At each node, compare its value with its children's values to decide whether to extend the path.

4. Track the global maximum

Use a global variable to keep track of the maximum path length found so far, updating it at each node by considering the sum of left and right extensions (if both children match).

5. Analyze complexity and edge cases

State that the time complexity is O(n) and space complexity is O(h) for recursion stack. Discuss edge cases like empty tree, single node, all nodes same value, and skewed trees.

Key Points to Mention

  • Definition of a path: typically a sequence of connected nodes; clarify if it can go through the parent or must be downward.
  • Recursive DFS approach: compute longest same-value path in left and right subtrees.
  • Combining paths: if current node's value equals both children's values, the longest path through the node is left + right + 1.
  • Global maximum tracking: update a global variable at each node to capture the longest path anywhere in the tree.
  • Time and space complexity: O(n) time, O(h) space for recursion stack.
  • Edge cases: empty tree, single node, all nodes same value, skewed tree, and nodes with only one child.

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

Q2

Standard behavioral and culture-fit questions covering how you work, handle disagreements, and operate on a team.

Adaptability & Ambiguity
Author's notes

Nothing surprising here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Use the STAR method to structure your answers, focusing on specific examples that highlight your adaptability, collaboration, and problem-solving skills. Emphasize how you navigate ambiguity, handle disagreements constructively, and contribute to team success, aligning with Google's values of innovation and user focus.

Pro tip: Show self-awareness by acknowledging what you learned from challenging situations and how you adapted your approach; Google values humility and a growth mindset.

1. Set the Context

Briefly describe the situation and task, ensuring it's relevant to the question and highlights a challenging or ambiguous scenario.

2. Detail Your Actions

Explain the specific steps you took, emphasizing your thought process, collaboration with others, and how you navigated ambiguity or disagreement.

3. Highlight the Outcome

Share the results of your actions, quantifying impact where possible and showing how you contributed to team or project success.

4. Reflect and Learn

Conclude with what you learned from the experience and how it has influenced your subsequent work or approach to similar situations.

Key Points to Mention

  • Adaptability to changing requirements or ambiguous problem statements
  • Constructive handling of disagreements by focusing on data and user impact
  • Collaboration and communication within cross-functional teams
  • Ownership and initiative in driving projects forward
  • Learning from failures or setbacks and applying lessons to future work
  • Alignment with Google's culture of innovation, user focus, and teamwork

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

Q3

Given a set of tasks and CPUs, schedule the tasks optimally. Follow-up: find the minimum number of CPUs required to achieve the best possible completion time.

Algorithms & Data StructuresSystem Design
Author's notes

Onsite, first day back after the five-month gap.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem constraints (task durations, dependencies, preemption, CPU homogeneity) and define the objective (minimize makespan). Then propose a greedy algorithm like Longest Processing Time first (LPT) for identical CPUs, and for the follow-up, use binary search on the number of CPUs combined with a feasibility check (e.g., can K CPUs finish within a given time?).

Pro tip: Mention that the problem is NP-hard for arbitrary constraints, so you'd use heuristics or approximation algorithms; for the follow-up, binary search on CPUs is efficient because feasibility is monotonic. Also, discuss trade-offs between optimality and practical runtime.

1. Clarify constraints and objective

Ask about task dependencies, preemption, CPU homogeneity, and whether the goal is to minimize makespan or maximize throughput. Confirm if tasks can be split.

2. Choose an algorithm for initial scheduling

For identical CPUs and independent tasks, use LPT: sort tasks descending and assign each to the least loaded CPU. For dependent tasks, consider list scheduling or critical path methods.

3. Analyze complexity and optimality

State that LPT gives a 4/3-approximation for makespan. If optimality is required, mention dynamic programming or branch-and-bound for small inputs, but acknowledge NP-hardness.

4. Address follow-up: minimum CPUs for best completion time

Binary search on the number of CPUs K. For each K, check if a schedule exists with makespan ≤ T* (the optimal makespan with unlimited CPUs). Feasibility can be checked via greedy simulation or bin packing.

5. Discuss practical considerations and extensions

Mention real-world factors like CPU heterogeneity, task priorities, and dynamic arrivals. Suggest using priority queues for efficient simulation.

Key Points to Mention

  • NP-hardness of scheduling problems and the need for heuristics/approximations
  • Longest Processing Time (LPT) algorithm and its approximation ratio
  • Binary search on the number of CPUs for the follow-up, leveraging monotonic feasibility
  • Feasibility check via greedy simulation or bin packing (e.g., First Fit Decreasing)
  • Use of priority queues (min-heap) to efficiently assign tasks to least loaded CPU
  • Trade-offs between optimality, runtime, and practical constraints

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

Q4

Given a set of points on a plane, find the maximum area rectangle that can be formed using those points as corners.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This is the one I'm least confident about.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem constraints (e.g., input size, whether points are distinct, and if rectangles can be axis-aligned or rotated). Then propose an efficient algorithm: group points by x-coordinate, for each pair of x-coordinates find all pairs of y-coordinates that exist at both x's, and compute the maximum area. Discuss time/space complexity and potential optimizations.

Pro tip: Mention that the naive O(n^4) approach is too slow for large inputs, and that using a hash set for point lookup can reduce the complexity to O(n^2) on average. Also, consider edge cases like collinear points or duplicate points.

1. Clarify the problem

Ask about input size, whether points are distinct, if rectangles must be axis-aligned, and if the rectangle can be degenerate (zero area).

2. Discuss brute force

Explain that checking all quadruples of points is O(n^4) and impractical for large n, but it's a good starting point to understand the problem.

3. Propose optimized approach

Group points by x-coordinate. For each pair of x-coordinates, find the intersection of y-values. For each pair of common y-values, check if the four corners exist (using a hash set). Compute area and track maximum.

4. Analyze complexity

The approach runs in O(n^2) on average with a hash set, but worst-case O(n^3) if many points share x-coordinates. Space is O(n) for the hash set.

5. Handle edge cases and trade-offs

Discuss handling duplicate points, collinear points, and whether to consider rotated rectangles. Mention that if rectangles can be rotated, the problem becomes more complex (e.g., using dot product and distance checks).

Key Points to Mention

  • Time complexity: O(n^2) average with hash set, O(n^3) worst-case.
  • Space complexity: O(n) for storing points in a hash set.
  • Use of hash set for O(1) point lookup.
  • Grouping by x-coordinate to reduce redundant checks.
  • Edge cases: duplicate points, collinear points, degenerate rectangles.
  • Trade-off: axis-aligned vs. arbitrary rotation.

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