Google Interview Prep (L4 / L5)

Google’s SWE interview is purely DSA-focused for L4 (SDE-2 equivalent). L5+ adds system design. The coding bar is higher than most companies β€” expect medium-hard problems with follow-ups. They evaluate HOW you think, not just whether you get the answer.


Interview Process

L4 (Software Engineer III)

Stage Duration Focus
Google Hiring Assessment (GHA) Online 2 coding problems (medium)
Recruiter Screen 30 min Background, level, prep timeline
Phone Screen 45 min 1-2 DSA problems (medium-hard)
Onsite Round 1 45 min Coding (medium-hard)
Onsite Round 2 45 min Coding (medium-hard)
Onsite Round 3 45 min Coding (hard with follow-ups)
Googleyness 45 min Behavioral (collaboration, ambiguity)

No system design for L4 in most cases. All coding.

L5 (Senior Software Engineer)

Same as L4 but adds:


HLD Problems Asked at Google

# Problem Difficulty Link
1 Key-Value Store Beginner Read β†’
2 Google Docs (Collaborative Editing) Advanced Read β†’
3 YouTube / Netflix (Video Streaming) Advanced Read β†’
4 Rate Limiter Beginner Read β†’
5 URL Shortener Beginner Read β†’
6 Notification System Intermediate Read β†’
7 News Aggregator (Google News) Intermediate Read β†’

DSA Problems Asked at Google (2024-2026)

Graphs β€” Google’s #1 Topic (asked in 40%+ of interviews)

# Problem Pattern Difficulty Link
1 Number of Islands BFS/DFS Grid Medium Solve β†’
2 Word Ladder BFS Shortest Path Hard Solve β†’
3 Course Schedule Topological Sort Medium Solve β†’
4 Course Schedule II Topological Sort Medium Solve β†’
5 Clone Graph BFS + HashMap Medium LeetCode β†’
6 Network Delay Time Dijkstra Medium Solve β†’
7 Accounts Merge Union-Find Medium LeetCode β†’
8 Alien Dictionary Topological Sort Hard LeetCode β†’
9 Pacific Atlantic Water Flow Multi-source DFS Medium Solve β†’
10 Shortest Path in Binary Matrix BFS Medium LeetCode β†’
11 Minimum Height Trees Topological BFS Medium LeetCode β†’
12 Swim in Rising Water BFS + Heap Hard Solve β†’
13 Critical Connections in Network Tarjan’s (Bridges) Hard LeetCode β†’
14 Rotting Oranges Multi-source BFS Medium Solve β†’
15 Cheapest Flights Within K Stops BFS / Bellman-Ford Medium LeetCode β†’
16 Graph Valid Tree Union-Find / DFS Medium Solve β†’
17 Redundant Connection Union-Find Medium Solve β†’

Dynamic Programming β€” Google’s #2 Topic

# Problem Pattern Difficulty Link
18 Longest Increasing Subsequence DP + Binary Search Medium Solve β†’
19 Word Break DP Medium Solve β†’
20 Coin Change Unbounded Knapsack Medium Solve β†’
21 Edit Distance 2D DP Medium Solve β†’
22 Unique Paths Grid DP Medium Solve β†’
23 Burst Balloons Interval DP Hard Solve β†’
24 Decode Ways Linear DP Medium Solve β†’
25 Maximum Product Subarray DP Medium Solve β†’
26 Longest Common Subsequence 2D DP Medium Solve β†’
27 Jump Game II Greedy Medium Solve β†’
28 Regular Expression Matching 2D DP Hard Solve β†’

Trees

# Problem Pattern Difficulty Link
29 Binary Tree Maximum Path Sum DFS Hard Solve β†’
30 Serialize and Deserialize Binary Tree BFS/DFS Hard LeetCode β†’
31 Lowest Common Ancestor DFS Medium LeetCode β†’
32 Validate BST DFS + Range Medium Solve β†’
33 Binary Tree Level Order Traversal BFS Medium Solve β†’
34 Construct Binary Tree from Preorder and Inorder Recursion Medium LeetCode β†’
35 Count Good Nodes DFS Medium Solve β†’
36 Kth Smallest Element in BST Inorder Medium Solve β†’
# Problem Pattern Difficulty Link
37 Search in Rotated Sorted Array Modified BS Medium Solve β†’
38 Median of Two Sorted Arrays Binary Search Hard LeetCode β†’
39 Koko Eating Bananas BS on Answer Medium Solve β†’
40 Split Array Largest Sum BS + Greedy Hard LeetCode β†’
41 Time Based Key-Value Store HashMap + BS Medium Solve β†’

Sliding Window / Two Pointers

# Problem Pattern Difficulty Link
42 Minimum Window Substring Sliding Window Hard LeetCode β†’
43 Longest Substring Without Repeating Characters Sliding Window Medium Solve β†’
44 3Sum Two Pointers + Sort Medium Solve β†’
45 Container With Most Water Two Pointers Medium Solve β†’
46 Trapping Rain Water Two Pointers / Stack Hard Solve β†’
47 Sliding Window Maximum Monotonic Deque Hard Solve β†’

Stack / Monotonic Stack

# Problem Pattern Difficulty Link
48 Largest Rectangle in Histogram Monotonic Stack Hard Solve β†’
49 Basic Calculator Stack + Recursion Hard LeetCode β†’
50 Daily Temperatures Monotonic Stack Medium Solve β†’

Heap / Priority Queue

# Problem Pattern Difficulty Link
51 Find Median from Data Stream Two Heaps Hard LeetCode β†’
52 Merge K Sorted Lists Min-Heap Hard Solve β†’
53 Kth Largest Element QuickSelect / Heap Medium Solve β†’
54 Top K Frequent Elements Heap / Bucket Sort Medium Solve β†’
55 Task Scheduler Greedy / Heap Medium Solve β†’

Design (Coding)

# Problem Pattern Difficulty Link
56 LRU Cache HashMap + DLL Medium Solve β†’
57 Implement Trie Trie Medium Solve β†’
58 Design Search Autocomplete Trie + Heap Hard LeetCode β†’
59 Snapshot Array Binary Search Medium LeetCode β†’

Backtracking

# Problem Pattern Difficulty Link
60 Word Search II Trie + Backtrack Hard LeetCode β†’
61 Permutations Backtracking Medium Solve β†’
62 Combination Sum Backtracking Medium Solve β†’
63 N-Queens Backtracking Hard LeetCode β†’
64 Generate Parentheses Backtracking Medium Solve β†’

Google-Specific Questions (Actually Asked in 2024-2026)

These are custom/variant problems reported from actual Google interviews:

# Problem Description Pattern Source
1 Binary tree with binary values β€” count β€œislands” (connected components of 1s) Tree DFS New Grad 2026
2 Encode and Decode a directed graph (serialization with cycle handling) Graph DFS + Serialization L4 Feb 2025
3 Reach target volume with N water jugs (fill/empty/pour operations) BFS State Space L4 Feb 2025
4 Alice and Bob minimize combined travel cost to a destination (weighted graph) Dijkstra from multiple sources L4 Feb 2025
5 Find node that when made root converts graph to binary tree (max 3 edges per node) Tree / Graph L4 Phone Screen 2025
6 Find all critical edges in a connected graph (bridges) Tarjan’s Algorithm L4 Bangalore 2025
7 Minimum health required to reach destination in weighted graph Graph DP / Dijkstra L4 Onsite 2025
8 Network of teleporters β€” some broken β€” find reachable nodes Graph BFS/DFS L4 2025
9 Given match results determine player rankings (topological sort with full ordering) Modified Topo Sort L4 India 2025
10 108 cards (4 sets of 27) β€” find if 12 cards can split into 4 winning groups of 3 Backtracking / DP L4 India 2025
11 Find minimum threshold distance for path from source to target in graph Binary Search + BFS/Dijkstra L4 India 2025
12 Minimum cost to cut all leaf nodes from root (weighted tree edges) Tree DP L4 2025
13 Alice and Bob share cab β€” minimize distinct roads crossed Graph (Steiner Tree variant) L4 USA 2025
14 Find valid path visiting all nodes in undirected graph Hamiltonian Path / DFS L4 Cloud 2025
15 Predict next word based on given sentences (design API) Trie / HashMap L4 MLE India 2025
16 Delete storage parts in valid order (no children when deleted) Topological Sort (Leaf removal) L4 Hyderabad 2025
17 Graph β€” find path between restricted edges after adding edges one by one Union-Find / BFS Off-campus
18 Post-order DFS traversal with hard follow-up Tree DFS L4 Warsaw 2025
19 State transition β€” given initial and final state, check if reachable BFS/DFS State Space L4 India 2025
20 Routers broadcast within distance d β€” check if destination gets message Graph BFS L3 Oct 2024

More Real Questions from Interview Experiences (2023-2026)

Additional specific problems reported by candidates across LeetCode, GeeksforGeeks, and interview blogs. These are the exact variants Google asked (paraphrased):

# Problem Description Pattern Round
21 Find where to cut a rectangular cake so both halves have equal area (return distance as double) Binary Search on Answer / Geometry Onsite
22 Assign patients (arrival + duration) to N rooms, return room that served the most patients Heap / Interval Scheduling Onsite Hard
23 Symbolic algebra: simplify c-(b-(d+e)) with nested parens and sign flips Stack Parsing Onsite
24 N CPUs, M task durations β€” find minimum makespan; follow-up: fewest CPUs to still hit it Heap / Binary Search on Answer DSA
25 NΓ—M grid β€” count unlock-pattern paths of length β‰₯ L (8 directions, no jumping visited) Backtracking / DFS DSA
26 Sum of distances from each tree node to all others β€” optimize O(nΒ²) to O(n) Tree DP (Rerooting) Onsite
27 Graph where vertices own intervals, edges connect overlapping ones β€” count spanning trees Union-Find / Matrix-Tree Onsite
28 Shortest path avoiding a set of forbidden/restricted nodes Graph / BFS Onsite
29 Undirected graph forming one ring β€” print every ring traversal from each node Graph / Cycle DFS Onsite
30 Water pours from each grid cell β€” find where it settles (DFS + memo) Grid DP / Memoized DFS Onsite
31 Power propagation through a 3D lattice/cube graph from source nodes to targets Multi-source BFS (3D) Onsite
32 IP-range-to-location file β€” answer which city a query IP belongs to; batch follow-up Binary Search / Interval Coding
33 Stream of timestamped messages β€” keep only last 10 time units using a deque Sliding Window / Deque Coding
34 Row of L/R pieces that slide without jumping β€” can config A transform to target B? Two Pointers / Greedy Coding
35 12 cards from 108-card deck β€” can they split into 4 winning groups of 3? Backtracking / Partition Coding
36 Binary tree with 0/1 node values β€” count connected islands of 1-nodes Tree DFS New Grad
37 Two strings β€” is there a common cut so prefix(A) + suffix(B) is a palindrome? String / Palindrome Phone Screen
38 Boolean stream data structure: setTrue(i), setFalse(i), setAllTrue(), getIndex(i) optimally Design / Lazy Propagation Onsite
39 Leaderboard: updateEntry(name), getEntryFromRank(rank) efficiently Design / Order-Statistics Tree Onsite
40 Lexicographically smallest subsequence of length exactly k Greedy / Monotonic Stack Onsite
41 Grid of people + bikes β€” find nearest bike for each person, handle ties BFS / Grid / Matching Onsite
42 Infinite chessboard β€” min knight moves to (x,y); follow-up adds forbidden cells Bidirectional BFS Onsite
43 Invertible mapping F(x,y)=z and inverse F(z)=(x,y) Math / Cantor Pairing Onsite
44 1M numbers, many (left,right) queries β€” max within each range Sparse Table / Segment Tree Onsite
45 Thief crosses room avoiding circular sensors β€” is a clear path possible? Union-Find / Geometry Onsite
46 Bench of n seats β€” each arrival picks seat maximizing distance to nearest occupant Heap / Greedy Onsite
47 0/1 string β€” min splits so each part is binary of a power of 5 (no leading zeros) DP (String Partition) Onsite
48 I/D pattern β€” smallest number with non-repeating digits 1-9 following it Greedy / Stack Phone Screen
49 Tree with edge weights, k leaves β€” min-weight edge deletion so no two leaves connected Tree DP / Min-Cut DSA
50 Flights (src, dst, arrival, departure) β€” shortest route arriving before deadline Graph / Dijkstra (time-constrained) DSA
51 Ship with fuel K β€” travel (K-1) or rest (K+1), H mandatory holidays, maximize distance DP (3D State) DSA
52 Read strings from n files β€” max count of elements shared by at least two files Hashing / Counting Coding
53 Longest substring that appears more than once (longest repeated substring) Suffix Array / Rolling Hash Coding
54 Decode nested encoded string like 3[a2[c]] into expanded form Stack / Recursion Coding
55 Tree stored as array + indices to erase β€” remove nodes + descendants in-place Array / Tree Compaction Coding

Google’s Favorite Patterns (Ranked by Frequency)

Rank Pattern Frequency Example Problems
1 Graph BFS/DFS Very High Islands, Word Ladder, Critical Edges
2 Dynamic Programming Very High LIS, Burst Balloons, Edit Distance
3 Tree DFS/BFS High Max Path Sum, Serialize Tree, LCA
4 Binary Search (variants) High Rotated Array, BS on Answer
5 Topological Sort High Course Schedule, Alien Dictionary, Rankings
6 Union-Find (DSU) Medium-High Accounts Merge, Graph Valid Tree
7 Sliding Window Medium Min Window Substring
8 Backtracking Medium Word Search II, N-Queens
9 Monotonic Stack Medium Histogram, Daily Temperatures
10 BFS on State Space Medium Water Jugs, State Transitions

Key insight for Google: They rarely ask straightforward LeetCode problems. They ask VARIANTS β€” same pattern but with a twist. If you understand the pattern deeply, you can handle the twist.


Googleyness Questions (Behavioral)

# Question
1 Tell me about a time you disagreed with a teammate. How did you resolve it?
2 Tell me about a time you had to work with ambiguous requirements.
3 Tell me about a time you simplified a complex system or process.
4 Tell me about a time you had to push back on a stakeholder.
5 Tell me about a time you made a technical decision that turned out to be wrong. What did you do?
6 Tell me about a time you helped someone on your team grow.
7 How do you handle disagreements in code reviews?
8 Tell me about a time you delivered under tight deadlines with incomplete information.

For L4: Focus on collaboration, growth mindset, handling ambiguity. For L5: Focus on leadership without authority, influencing across teams, setting technical direction.


14-Day Prep Plan (L4)

Day Topic Problems to Solve
1 Arrays + Two Pointers 3Sum, Container With Most Water, Trapping Rain Water
2 Sliding Window Min Window Substring, Longest Substring, Sliding Window Max
3 Binary Search Rotated Array, Koko Bananas, Median of Two Arrays
4 Trees (Part 1) Validate BST, LCA, Binary Tree Max Path Sum
5 Trees (Part 2) Serialize/Deserialize, Level Order, Construct from Preorder
6 Graphs - BFS/DFS Number of Islands, Word Ladder, Shortest Path in Matrix
7 Graphs - Topo Sort + UF Course Schedule II, Alien Dictionary, Accounts Merge
8 DP (Part 1) LIS, Coin Change, Word Break, Edit Distance
9 DP (Part 2) Burst Balloons, Unique Paths, Decode Ways
10 Backtracking + Stack Permutations, Generate Parens, Largest Rectangle
11 Heap + Design Merge K Lists, Find Median, LRU Cache
12 Google-specific problems Pick 5 from the β€œActually Asked” table above
13 Revision Redo 8-10 problems you struggled with
14 Rest + light review Review patterns mentally. Sleep early.

Tips for Google Interviews

  1. Think out loud. Google evaluates your thought process. Start with brute force, discuss complexity, then optimize. Silence = no signal for the interviewer.
  2. Ask clarifying questions. β€œCan the input be empty? Are there negative numbers? Is the graph connected?” Shows maturity.
  3. Handle follow-ups. Google’s style: solve base problem in 15 min β†’ interviewer adds constraints β†’ solve harder version. Prepare for this.
  4. Code on plain text. Google uses Google Docs (no autocomplete, no syntax highlighting). Practice without IDE.
  5. Edge cases matter. Empty input, single element, duplicates, overflow. Mention these before the interviewer asks.
  6. Consistency across rounds. Hiring committee reviews ALL rounds. One great round doesn’t save a bad one.
  7. Graphs are mandatory. If you skip graph prep, you’ll likely fail. Google asks graphs more than any other FAANG.

Other Company Prep

Free system design + DSA prep. If it helped you crack an interview, consider supporting.