Google Coding Interview Questions
Google problems
Google is known for harder-than-average problems and interviewers who probe scalability with follow-ups. High-frequency patterns: binary search, dynamic programming, graphs, and hashing. Expect to discuss trade-offs and worst-case complexity in depth on every solution.
Google Interview Loop Structure
- • Discuss trade-offs and worst-case complexity in depth
- • Expect follow-up questions that tighten memory and runtime constraints
- • Practice explaining your approach before touching any code
4-Week Preparation Strategy for Google
Action PlanTo maximize your offer probability at Google, avoid random LeetCode grinding. Follow this structured 4-week roadmap tailored to Google's specific interview loop and evaluation bar:
Week 1: High-Frequency Patterns
Focus on foundational patterns tested heavily at Google: Two Pointers, Sliding Window, and Hash Map frequency tracking. Solve 10–12 Easy/Medium questions and establish code muscle memory without syntax lookups.
Week 2: Advanced Graph & Tree Drills
Master BFS, DFS, Topological Sorting, and Priority Queues (Min/Max Heaps). Practice articulating state transitions and recursion stack depth trade-offs under real-time interviewer pressure.
Week 3: Timed Mock Coding & Complexity
Simulate real 45-minute technical screens. Spend 5 minutes clarifying requirements, 10 minutes discussing brute-force vs optimal trade-offs, 20 minutes coding cleanly, and 10 minutes dry-running boundary test cases.
Week 4: System Architecture & Behavioral STAR
Draft 5 distinct STAR method stories (Situation, Task, Action, Result) mapped to Google's core principles. Review distributed systems fundamentals: caching tiers, partitioning, rate limiting, and database consistency models.
💡 What Google Interviewers Evaluate:
Interviewers score candidates across 4 independent pillars: Algorithmic Optimality (arriving at optimal Big-O), Code Craftsmanship (modular functions, clean naming, zero syntax debt), Communication & Thinking Out Loud (proactive collaboration, asking clarifying questions), and Edge Case Rigor (null checks, integer overflows, duplicate inputs).
High Frequency at Google
Most AskedThese problems appear most frequently in Google interviews based on reported data.
| Problem | Difficulty | Solution | Link | |
|---|---|---|---|---|
| Subarray Sum Equals K
#Array
#Hash Map
#Prefix Sum | Medium | Solution | ||
| Find Pivot Index
#Array
#Prefix Sum | Easy | Solution | ||
| Max Chunks To Make Sorted
#Array | Medium | Solution | ||
| Max Chunks To Make Sorted II
#Array | Medium | Solution |
| Problem | Difficulty | Solution | Link | |
|---|---|---|---|---|
| Two Sum
#Array
#Hash Map | Easy | Solution | ||
| Top K Frequent Elements
#Array
#Hash Map
#Heap | Medium | Solution | ||
| Longest Consecutive Sequence
#Array
#Hash Set | Medium | Solution | ||
| Contains Duplicate
#Array
#Hash Table
#Sorting | Easy | Solution | ||
| LRU Cache
#Hash Table
#Linked List
#Design | Medium | Solution | ||
| 4Sum II
#Array
#Hash Table | Medium | Solution | ||
| Subarray Sum Divisible by K
#Array
#Hash Table
#Prefix Sum | Medium | Solution |
| Problem | Difficulty | Solution | Link | |
|---|---|---|---|---|
| Number of Islands
#Array
#DFS
#BFS | Medium | Solution | ||
| Rotting Oranges
#Array
#BFS
#Matrix | Medium | Solution | ||
| Word Ladder
#Hash Set
#BFS
#String | Hard | Solution | ||
| Shortest Path in Binary Matrix
#Array
#BFS
#Matrix | Medium | Solution | ||
| Open the Lock
#Array
#Hash Table
#BFS | Medium | Solution | ||
| Minimum Genetic Mutation
#Hash Table
#String
#BFS | Medium | Solution | ||
| Jump Game III
#Array
#DFS
#BFS | Medium | Solution |
| Problem | Difficulty | Solution | Link | |
|---|---|---|---|---|
| Kth Largest Element in an Array
#Array
#Heap
#Sorting | Medium | Solution | ||
| Find Median from Data Stream
#Two Heaps
#Design
#Sorting | Hard | Solution | ||
| Merge K Sorted Lists
#Linked List
#Heap
#Divide and Conquer | Hard | Solution | ||
| Reorganize String
#Hash Table
#String
#Greedy | Medium | Solution | ||
| Top K Frequent Words
#Hash Table
#String
#Trie | Medium | Solution | ||
| Find K Pairs with Smallest Sums
#Array
#Heap | Medium | Solution | ||
| Sort an Almost Sorted Array
#Heap
#Priority Queue | Medium | Solution | ||
| Find K Closest Elements
#Heap
#Priority Queue | Medium | Solution | ||
| Connect Ropes to Minimize the Cost
#Heap
#Priority Queue | Medium | Solution | ||
| The sum of Elements between k1 smallest and k2 smallest numbers
#Heap
#Priority Queue | Medium | Solution | ||
| Kth Largest Element in a Stream
#Heap
#Priority Queue | Medium | Solution |
| Problem | Difficulty | Solution | Link | |
|---|---|---|---|---|
| Invert Binary Tree
#Tree
#DFS
#BFS | Easy | Solution | ||
| Serialize and Deserialize Binary Tree
#Tree
#DFS
#BFS | Hard | Solution | ||
| Diameter of Binary Tree
#Tree
#DFS
#Binary Tree | Easy | Solution | ||
| Construct Binary Tree from Preorder and Inorder Traversal
#Array
#Hash Table
#Divide and Conquer | Medium | Solution | ||
| Sum Root to Leaf Numbers
#Tree
#DFS
#BFS | Medium | Solution | ||
| Same Tree
#Tree
#Depth-First Search
#Breadth-First Search | Easy | Solution |
| Problem | Difficulty | Solution | Link | |
|---|---|---|---|---|
| Clone Graph
#Graph
#DFS
#BFS | Medium | Solution | ||
| Pacific Atlantic Water Flow
#Graph
#DFS
#BFS | Medium | Solution | ||
| Number of Connected Components in Undirected Graph
#Graph
#DFS
#Union Find | Medium | Solution | ||
| Surrounded Regions
#Array
#DFS
#BFS | Medium | Solution | ||
| Minimum Height Trees
#DFS
#BFS
#Graph | Medium | Solution | ||
| Network Delay Time
#DFS
#BFS
#Graph | Medium | Solution | ||
| Find Eventual Safe States
#DFS
#BFS
#Graph | Medium | Solution | ||
| All Paths From Source to Target
#Backtracking
#DFS
#BFS | Medium | Solution | ||
| Cheapest Flights Within K Stops
#Dynamic Programming
#DFS
#BFS | Medium | Solution | ||
| Graph Valid Tree
#Depth-First Search
#Breadth-First Search
#Union Find | Medium | Solution |
| Problem | Difficulty | Solution | Link | |
|---|---|---|---|---|
| House Robber
#Array
#DP | Medium | Solution | ||
| Coin Change
#Array
#DP
#BFS | Medium | Solution | ||
| Longest Increasing Subsequence
#Array
#DP
#Binary Search | Medium | Solution | ||
| Longest Common Subsequence
#String
#DP | Medium | Solution | ||
| Word Break
#String
#DP
#Hash Set | Medium | Solution | ||
| Edit Distance
#String
#DP | Hard | Solution | ||
| Unique Paths
#Math
#DP
#Combinatorics | Medium | Solution | ||
| Min Cost Climbing Stairs
#Array
#Dynamic Programming | Easy | Solution | ||
| House Robber II
#Array
#Dynamic Programming | Medium | Solution | ||
| Target Sum
#Array
#Dynamic Programming
#Backtracking | Medium | Solution | ||
| Best Time to Buy and Sell Stock
#Array
#Dynamic Programming | Easy | Solution | ||
| Longest Palindromic Substring
#String
#Dynamic Programming | Medium | Solution | ||
| Best Time to Buy and Sell Stock with Cooldown
#Array
#Dynamic Programming | Medium | Solution | ||
| Maximum Product Subarray
#Array
#Dynamic Programming | Medium | Solution | ||
| Minimum Path Sum
#Array
#Dynamic Programming
#Matrix | Medium | Solution | ||
| Perfect Squares
#Math
#Dynamic Programming
#BFS | Medium | Solution | ||
| Regular Expression Matching
#String
#Dynamic Programming
#Recursion | Hard | Solution | ||
| Interleaving String
#String
#Dynamic Programming
#BFS | Medium | Solution | ||
| Best Time to Buy and Sell Stock with Transaction Fee
#Array
#Dynamic Programming
#Greedy | Medium | Solution | ||
| Integer Break
#Math
#Dynamic Programming | Medium | Solution |
| Problem | Difficulty | Solution | Link | |
|---|---|---|---|---|
| Jump Game II
#Array
#Greedy
#DP | Medium | Solution | ||
| Gas Station
#Array
#Greedy | Medium | Solution | ||
| Non-overlapping Intervals
#Array
#Greedy
#Dynamic Programming | Medium | Solution | ||
| Meeting Rooms II
#Array
#Greedy
#Sorting | Medium | Solution | ||
| Queue Reconstruction by Height
#Array
#Greedy
#Sorting | Medium | Solution | ||
| Candy
#Array
#Greedy | Hard | Solution |
| Problem | Difficulty | Solution | Link | |
|---|---|---|---|---|
| Implement Trie (Prefix Tree)
#Design
#Trie | Medium | Solution | ||
| Word Search II
#Array
#String
#Backtracking | Hard | Solution | ||
| Longest Word in Dictionary
#Array
#Hash Table
#String | Medium | Solution |
| Problem | Difficulty | Solution | Link | |
|---|---|---|---|---|
| Redundant Connection
#Graph
#Union Find
#DFS | Medium | Solution | ||
| Accounts Merge
#Graph
#Union Find
#DFS | Medium | Solution | ||
| Number of Provinces
#DFS
#BFS
#Union-Find | Medium | Solution | ||
| Satisfiability of Equality Equations
#Array
#String
#Union-Find | Medium | Solution | ||
| Swim in Rising Water
#Array
#Binary Search
#DFS | Hard | Solution |
| Problem | Difficulty | Solution | Link | |
|---|---|---|---|---|
| Largest Rectangle in Histogram
#Array
#Stack
#Monotonic Stack | Hard | Solution | ||
| Sum of Subarray Minimums
#Array
#Dynamic Programming
#Stack | Medium | Solution | ||
| 132 Pattern
#Array
#Binary Search
#Stack | Medium | Solution | ||
| Remove Duplicate Letters
#String
#Stack
#Greedy | Medium | Solution | ||
| Stock Span Problem
#Stack | Medium | Solution |
| Problem | Difficulty | Solution | Link | |
|---|---|---|---|---|
| Course Schedule
#Graph
#DFS
#BFS | Medium | Solution | ||
| Parallel Courses
#Graph
#Topological Sort
#BFS | Medium | Solution | ||
| Sequence Reconstruction
#Array
#Graph
#Topological Sort | Medium | Solution | ||
| Alien Dictionary
#Array
#String
#Graph | Hard | Solution |
| Problem | Difficulty | Solution | Link | |
|---|---|---|---|---|
| Counting Bits
#DP
#Bit Manipulation | Easy | Solution | ||
| Number of 1 Bits
#Divide and Conquer
#Bit Manipulation | Easy | Solution | ||
| Power of Two
#Math
#Bit Manipulation
#Recursion | Easy | Solution |
| Problem | Difficulty | Solution | Link | |
|---|---|---|---|---|
| Merge Intervals
#Array
#Sorting | Medium | Solution | ||
| Insert Interval
#Array | Medium | Solution | ||
| Minimum Interval to Include Each Query
#Array
#Binary Search
#Line Sweep | Hard | Solution | ||
| Meeting Rooms
#Array
#Sorting | Easy | Solution |
| Problem | Difficulty | Solution | Link | |
|---|---|---|---|---|
| Spiral Matrix
#Array
#Matrix
#Simulation | Medium | Solution | ||
| Game of Life
#Array
#Matrix
#Simulation | Medium | Solution | ||
| Search a 2D Matrix II
#Array
#Binary Search
#Divide and Conquer | Medium | Solution | ||
| Count Negative Numbers in a Sorted Matrix
#Array
#Binary Search
#Matrix | Easy | Solution |
| Problem | Difficulty | Solution | Link | |
|---|---|---|---|---|
| Letter Combinations of a Phone Number
#Hash Table
#String
#Backtracking | Medium | Solution | ||
| Generate Parentheses
#String
#Dynamic Programming
#Backtracking | Medium | Solution | ||
| Palindrome Partitioning
#String
#Dynamic Programming
#Backtracking | Medium | Solution | ||
| Next Permutation
#Array | Medium | Solution | ||
| Find all permutations of a string
#String | Medium | Solution | ||
| Find all permutations of a given string without duplicates
#String | Medium | Solution | ||
| Longest Valid Parentheses
#String | Easy | Solution |