Google Coding Interview Questions: 609 Tagged Problems
609 coding problems tagged Google — 107 easy · 363 medium · 139 hard — with solutions in 13 languages. Plus a 4-week study plan by topic.
- Problems: 609
- By difficulty: 107 easy · 363 medium · 139 hard
- Languages: JavaScript, TypeScript, Python, Java, C++, C, C#, Go, Kotlin, Swift, Rust, PHP and Ruby
- Cost: Free on every plan; sign in to run and submit
609 problems the CodeKairo catalogue tags as commonly asked in Google's coding rounds — 107 easy, 363 medium and 139 hard — each judged by hidden tests in 13 languages. The most common topics among them are Arrays (372), Dynamic Programming (155) and Strings (150). At 55% of the catalogue the tag is a broad net rather than a shortlist; the pattern below is the narrower place to start. CodeKairo's Google — Online Assessment mock covers the Google online assessment pattern for university candidates: two coding problems, one clock, and nothing else. The tag is the catalogue's own annotation of where a problem tends to come up — not a list published by Google, which CodeKairo is not affiliated with.
Google study plan by topic
40 of the 609 problems tagged Google over 4 weeks, about 21 h 20 min of solving, grouped by technique in the order they build on each other — Arrays, Strings, Hash Table and Counting and 23 more. It ends with the Google — Online Assessment mock.
Week 1: Arrays, Strings, Hash Table +5
12 problems on Arrays, Strings, Hash Table, Counting, Math, Two Pointers, Sliding Window and Prefix Sum, easiest first within each topic.
- Max Consecutive Ones Easy
- Detect Capital Easy
- Jewels and Stones Easy
- Majority Element II Medium
- Minimum Number of Frogs Croaking Medium
- Factorial Trailing Zeroes Medium
- Merge Strings Alternately Easy
- String Compression Medium
- Minimum Difference Between Highest and Lowest of K Scores Easy
- Maximum Number of Vowels in a Substring of Given Length Medium
- Find Pivot Index Easy
- Find the Highest Altitude Easy
Week 2: Sorting, Binary Search, Stack +4
11 problems on Sorting, Binary Search, Stack, Monotonic Stack, Matrix, Simulation and Greedy, easiest first within each topic.
- Largest Perimeter Triangle Easy
- Third Maximum Number Easy
- Count Pairs Whose Sum is Less than Target Easy
- Minimum Common Value Easy
- Count Negative Numbers in a Sorted Matrix Easy
- Longest Valid Parentheses Hard
- Number of Visible People in a Queue Hard
- Unique Paths II Medium
- Game of Life Medium
- Longest Palindrome Easy
- Increasing Triplet Subsequence Medium
Week 3: Heap, Bit Manipulation, Bitmask +7
12 problems on Heap, Bit Manipulation, Bitmask, Number Theory, Combinatorics, Backtracking, Graph, Breadth-First Search, Topological Sort and Union Find, easiest first within each topic.
- The K Weakest Rows in a Matrix Easy
- Top K Frequent Words Medium
- Counting Bits Easy
- Power of Two Easy
- Maximum AND Sum of Array Hard
- X of a Kind in a Deck of Cards Easy
- Number of Music Playlists Hard
- Word Search Medium
- Keys and Rooms Medium
- Word Ladder Hard
- Find Eventual Safe States Medium
- Surrounded Regions Medium
Week 4: Dynamic Programming, Game Theory
5 problems on Dynamic Programming and Game Theory, easiest first within each topic.
- Delete and Earn Medium
- Best Time to Buy and Sell Stock III Hard
- Distinct Subsequences Hard
- Palindrome Partitioning II Hard
- Stone Game III Hard
Finally: the timed test
Sit the Google — Online Assessment mock under the clock — the coding problems are only one part of the round.
Google test patterns
- Google — Online Assessment pattern guide and timed mock
All problems tagged Google
Easy (107)
- Find the Original Typed String I String
- Special Array I Array
- Type of Triangle Array, Math, Sorting
- Find the Losers of the Circular Game Array, Hash Table, Simulation
- Form Smallest Number From Two Digit Arrays Array, Hash Table, Enumeration
- Delete Greatest Value in Each Row Array, Matrix, Sorting
- The Employee That Worked on the Longest Task Array
- Calculate Delayed Arrival Time Math
- Most Frequent Even Element Array, Hash Table, Counting
- Rearrange Characters to Make Target String Hash Table, String, Counting
- Number of Strings That Appear as Substrings in Word Array, String
- Circular Sentence String
- Number of Senior Citizens Array, String
- Find Words Containing Character Array, String
- Strong Password Checker II String
- Decode the Message Hash Table, String
- Count Prefixes of a Given String Array, String
- Count Asterisks String
- Existence of a Substring in a String and Its Reverse String, Hash Table
- Number of Changing Keys String
- Find the Encrypted String String, Simulation
- Count the Number of Incremovable Subarrays I Array, Two Pointers, Enumeration
- Modify the Matrix Array, Matrix
- Find the Power of K-Size Subarrays I Array, Sliding Window
- Number of Bit Changes to Make Two Integers Equal Bit Manipulation
- Find the XOR of Numbers Which Appear Twice Array, Hash Table, Bit Manipulation
- Apple Redistribution into Boxes Array, Greedy, Sorting
- Number of Beautiful Pairs Array, Hash Table, Math
- Check if Array is Good Array, Hash Table, Sorting
- Neither Minimum nor Maximum Array, Sorting
- Alternating Groups I Array, Sliding Window
- Distribute Elements Into Two Arrays I Array, Simulation
- Minimum Sum of Mountain Triplets I Array, Prefix Sum
- Find the Integer Added to Array I Array, Math
- Minimum Operations to Exceed Threshold Value I Array
- Kids With the Greatest Number of Candies Array
- Separate the Digits in an Array Array, Simulation
- Find the Child Who Has the Ball After K Seconds Math, Simulation
- Minimum Time Visiting All Points Array, Math, Geometry
- Split the Array Array, Hash Table, Counting
- Find Champion II Graph
- Find Champion I Array, Matrix, Graph
- Minimum Amount of Time to Fill Cups Array, Greedy, Math
- Kth Missing Positive Number Array, Binary Search
- Minimum Recolors to Get K Consecutive Black Blocks String, Sliding Window
- Valid Word Abbreviation String, Two Pointers
- Rank Transform of an Array Array, Hash Table, Sorting
- Maximum Odd Binary Number String, Greedy
- Distribute Money to Maximum Children Math, Greedy
- Find the Winning Player in Coin Game Math, Game Theory
- Check If It Is a Straight Line Array, Math, Geometry
- Add to Array-Form of Integer Array, Math
- Permutation Difference between Two Strings String, Hash Table
- Remove Palindromic Subsequences String, Two Pointers
- Number of Different Integers in a String String, Hash Table
- Greatest Common Divisor of Strings String, Math
- Verifying an Alien Dictionary Array, String, Hash Table
- Unique Morse Code Words Array, String, Hash Table
- Long Pressed Name String, Two Pointers
- Maximum Difference Between Increasing Elements Array
- Replace Elements with Greatest Element on Right Side Array
- X of a Kind in a Deck of Cards Array, Math, Number Theory
- Fair Candy Swap Array, Hash Table
- Find the Difference Hash Table, String, Bit Manipulation
- Binary Gap Bit Manipulation
- Counting Bits Dynamic Programming, Bit Manipulation
- Number of 1 Bits Divide and Conquer, Bit Manipulation
- Largest Perimeter Triangle Array, Math, Greedy
- Assign Cookies Array, Two Pointers, Greedy
- Projection Area of 3D Shapes Array, Math, Geometry
- The K Weakest Rows in a Matrix Array, Binary Search, Sorting
- Count Negative Numbers in a Sorted Matrix Array, Binary Search, Matrix
- Flipping an Image Array, Two Pointers, Matrix
- Toeplitz Matrix Array, Matrix
- Number of Arithmetic Triplets Array, Hash Table, Two Pointers
- Minimum Common Value Array, Hash Table, Two Pointers
- Count Pairs Whose Sum is Less than Target Array, Two Pointers, Binary Search
- Rearrange Spaces Between Words String
- Special Array With X Elements Greater Than or Equal X Array, Binary Search, Sorting
- Array Partition Array, Greedy, Sorting
- Minimum Difference Between Highest and Lowest of K Scores Array, Sliding Window, Sorting
- Shortest Distance to a Character Array, Two Pointers, String
- Merge Strings Alternately Two Pointers, String
- Count Binary Substrings Two Pointers, String
- Unique Email Addresses Array, Hash Table, String
- Rotate String String, String Matching
- Buddy Strings Hash Table, String
- License Key Formatting String
- Jewels and Stones Hash Table, String
- Longest Palindrome Hash Table, String, Greedy
- Repeated Substring Pattern String, String Matching
- Detect Capital String
- Reverse Vowels of a String Two Pointers, String
- Third Maximum Number Array, Sorting
- Max Consecutive Ones Array
- Sum of All Odd Length Subarrays Array, Math, Prefix Sum
- Find the Highest Altitude Array, Prefix Sum
- How Many Numbers Are Smaller Than the Current Number Array, Hash Table, Counting Sort
- Find Pivot Index Array, Prefix Sum
- Set Mismatch Array, Hash Table, Bit Manipulation
- N-th Tribonacci Number Math, Dynamic Programming, Memoization
- Add Strings Math, String, Simulation
- Plus One Array, Math
- Add Binary Math, String, Bit Manipulation
- Power of Three Math, Recursion
- Power of Two Math, Bit Manipulation
- Happy Number Hash Table, Math, Two Pointers
Medium (363)
- Make Three Strings Equal String
- Minimum Number of Increments on Subarrays to Form a Target Array Array, Greedy, Dynamic Programming
- Find the Winner of an Array Game Array, Simulation
- Queries on a Permutation With Key Array, Binary Indexed Tree, Simulation
- Corporate Flight Bookings Array, Prefix Sum
- Find the Winner of the Circular Game Array, Math, Recursion
- Longest Subsequence With Limited Sum Array, Binary Search, Greedy
- Partition Array for Maximum Sum Array, Dynamic Programming
- Stone Game VII Array, Math, Dynamic Programming
- Minimum Number of Work Sessions to Finish the Tasks Array, Dynamic Programming, Bit Manipulation
- Count Fertile Pyramids in a Land Array, Dynamic Programming, Matrix
- Number of Ways to Divide a Long Corridor Math, String, Dynamic Programming
- Maximum Number of Non-overlapping Palindrome Substrings String, Dynamic Programming, Greedy
- Count Ways to Group Overlapping Ranges Array, Sorting, Math
- Count Number of Ways to Place Houses Math, Dynamic Programming
- Count Number of Texts Hash Table, Math, String
- Number of Ways to Reach a Position After Exactly k Steps Math, Dynamic Programming, Combinatorics
- Delete Characters to Make Fancy String String, Greedy
- Count Number of Homogenous Substrings Math, String
- Construct String With Repeat Limit Hash Table, String, Greedy
- Minimum Number of Steps to Make Two Strings Anagram II Hash Table, String, Counting
- Count Vowel Substrings of a String Hash Table, String, Sliding Window
- Longest Substring of All Vowels in Order String, Sliding Window
- Minimum Deletions to Make String Balanced String, Dynamic Programming, Stack
- Minimum Length of String After Operations Hash Table, String, Counting
- Minimum Number of Changes to Make Binary String Beautiful String, Greedy
- Lexicographically Minimum String After Removing Stars String, Greedy, Heap (Priority Queue)
- Count Substrings Starting and Ending with Given Character Math, String, Counting
- Sort Vowels in a String String, Sorting
- Find the Integer Added to Array II Array, Two Pointers, Sorting
- Minimum Operations to Exceed Threshold Value II Array, Heap (Priority Queue), Simulation
- Sum of Digit Differences of All Pairs Array, Hash Table, Math
- Alternating Groups II Array, Sliding Window
- Minimum Sum of Mountain Triplets II Array, Prefix Sum
- Count Days Without Meetings Array, Sorting
- Water Bottles II Math, Simulation
- Determine the Minimum Sum of a k-avoiding Array Array, Math, Greedy
- Find the Value of the Partition Array, Sorting
- Maximum Value of an Ordered Triplet II Array, Prefix Sum
- Process Tasks Using Servers Array, Simulation, Heap (Priority Queue)
- Maximum Number of Eaten Apples Array, Greedy, Heap (Priority Queue)
- K-th Smallest Prime Fraction Array, Binary Search, Sorting
- Find K Pairs with Smallest Sums Array, Heap (Priority Queue)
- Maximum Subsequence Score Array, Greedy, Sorting
- Total Cost to Hire K Workers Array, Two Pointers, Simulation
- Single-Threaded CPU Array, Sorting, Heap (Priority Queue)
- Most Beautiful Item for Each Query Array, Binary Search, Sorting
- Number of Orders in the Backlog Array, Simulation, Heap (Priority Queue)
- Maximum Number of Events That Can Be Attended Array, Greedy, Sorting
- The Number of the Smallest Unoccupied Chair Array, Hash Table, Heap (Priority Queue)
- Maximal Score After Applying K Operations Array, Greedy, Heap (Priority Queue)
- Find the Kth Largest Integer in the Array Array, String, Sorting
- Maximum Score From Removing Stones Math, Greedy, Heap (Priority Queue)
- Minimum Cost to Connect Sticks Array, Greedy, Heap (Priority Queue)
- Find the Safest Path in a Grid Array, Matrix, Binary Search
- Number of Ways to Arrive at Destination Graph, Dynamic Programming, Shortest Path
- Course Schedule IV Graph, Topological Sort, Depth-First Search
- Parallel Courses Graph, Topological Sort, Breadth-First Search
- Detonate the Maximum Bombs Array, Math, Graph
- The Maze II Array, Matrix, Graph
- Open the Lock Array, String, Breadth-First Search
- Loud and Rich Array, Graph, Topological Sort
- Shortest Path with Alternating Colors Graph, Breadth-First Search
- Number of Nodes in the Sub-Tree With the Same Label Hash Table, Tree, Graph
- Minimum Fuel Cost to Report to the Capital Tree, Graph, Depth-First Search
- Maximum Star Sum of a Graph Array, Graph, Greedy
- Count the Number of Complete Components Graph, Union Find, Depth-First Search
- Minimum Score of a Path Between Two Cities Graph, Union Find, Depth-First Search
- Reachable Nodes With Restrictions Array, Tree, Graph
- Largest Plus Sign Array, Matrix, Dynamic Programming
- Remove All Ones With Row and Column Flips Array, Matrix, Bit Manipulation
- Number of Corner Rectangles Array, Matrix, Math
- Magic Squares In Grid Array, Matrix, Simulation
- Construct Product Matrix Array, Matrix, Prefix Sum
- Maximum Number of Moves in a Grid Array, Matrix, Dynamic Programming
- Map of Highest Peak Array, Matrix, Breadth-First Search
- Check Knight Tour Configuration Array, Matrix, Depth-First Search
- First Completely Painted Row or Column Array, Matrix, Hash Table
- Find All Groups of Farmland Array, Matrix, Depth-First Search
- Matrix Block Sum Array, Matrix, Prefix Sum
- Spiral Matrix III Array, Matrix, Simulation
- Where Will the Ball Fall Array, Matrix, Simulation
- Maximum Matrix Sum Array, Matrix, Greedy
- Minimum Cost Tree From Leaf Values Array, Dynamic Programming, Stack
- The Number of Beautiful Subsets Array, Hash Table, Dynamic Programming
- Longest Binary Subsequence Less Than or Equal to K String, Greedy, Dynamic Programming
- Number of Ways to Select Buildings String, Dynamic Programming, Prefix Sum
- Number of People Aware of a Secret Queue, Dynamic Programming, Simulation
- Longest Ideal Subsequence Hash Table, String, Dynamic Programming
- Stone Game II Array, Dynamic Programming, Prefix Sum
- Predict the Winner Array, Dynamic Programming, Recursion
- Count Ways To Build Good Strings Dynamic Programming
- Longest Arithmetic Subsequence Array, Hash Table, Dynamic Programming
- Coin Change II Array, Dynamic Programming
- Minimum Impossible OR Array, Bit Manipulation, Brainteaser
- Minimum Additions to Make Valid String String, Greedy, Dynamic Programming
- Partition String Into Substrings With Values at Most K String, Greedy, Dynamic Programming
- Stone Game IX Array, Math, Greedy
- Minimum Operations to Make Median of Array Equal to K Array, Greedy, Sorting
- Destroy Sequential Targets Array, Hash Table, Counting
- Smallest Missing Non-negative Integer After Operations Array, Hash Table, Math
- Separate Black and White Balls String, Greedy, Two Pointers
- Find the Maximum Number of Marked Indices Array, Two Pointers, Greedy
- Maximum Split of Positive Even Integers Math, Greedy
- Count Collisions on a Road String, Stack, Simulation
- Video Stitching Array, Greedy, Dynamic Programming
- Eliminate Maximum Number of Monsters Array, Greedy, Sorting
- Minimum Number of Operations to Move All Balls to Each Box Array, String, Prefix Sum
- Minimum Number of Arrows to Burst Balloons Array, Greedy, Sorting
- Maximum Number of Removable Characters Array, String, Binary Search
- Divide Chocolate Array, Binary Search, Greedy
- Successful Pairs of Spells and Potions Array, Binary Search, Sorting
- Search a 2D Matrix II Array, Matrix, Binary Search
- Find Right Interval Array, Binary Search, Sorting
- House Robber IV Array, Binary Search, Greedy
- Minimize the Maximum Difference of Pairs Array, Binary Search, Greedy
- Maximum Candies Allocated to K Children Array, Binary Search
- H-Index II Array, Binary Search
- Find the Smallest Divisor Given a Threshold Array, Binary Search
- Maximum Value at a Given Index in a Bounded Array Binary Search, Greedy, Math
- Find the Student That Will Replace the Chalk Array, Binary Search, Prefix Sum
- Minimum Limit of Balls in a Bag Array, Binary Search
- Magnetic Force Between Two Balls Array, Binary Search, Sorting
- Minimum Number of Days to Make m Bouquets Array, Binary Search
- Capacity to Ship Packages Within D Days Array, Binary Search
- Find Minimum in Rotated Sorted Array II Array, Binary Search
- Search in Rotated Sorted Array II Array, Binary Search
- Minimum Swaps to Group All 1's Together II Array, Sliding Window
- Length of Longest Subarray With at Most K Frequency Array, Hash Table, Sliding Window
- Maximum Beauty of an Array After Applying Operation Array, Sliding Window, Sorting
- Number of Subarrays with Bounded Maximum Array, Sliding Window, Two Pointers
- Count the Number of Good Subarrays Array, Hash Table, Sliding Window
- Swap For Longest Repeated Character Substring String, Sliding Window, Hash Table
- Replace the Substring for Balanced String String, Sliding Window, Two Pointers
- Get Equal Substrings Within Budget String, Sliding Window, Binary Search
- Maximize the Confusion of an Exam String, Sliding Window, Prefix Sum
- Frequency of the Most Frequent Element Array, Sliding Window, Greedy
- Maximum Points You Can Obtain from Cards Array, Sliding Window, Prefix Sum
- Grumpy Bookstore Owner Array, Sliding Window
- Number of Substrings Containing All Three Characters String, Hash Table, Sliding Window
- Longest Substring with At Most K Distinct Characters String, Hash Table, Sliding Window
- Longest Substring with At Most Two Distinct Characters String, Hash Table, Sliding Window
- Watering Plants II Array, Two Pointers, Simulation
- Number of Subsequences That Satisfy the Given Sum Condition Array, Two Pointers, Sorting
- 3Sum With Multiplicity Array, Hash Table, Two Pointers
- Most Profit Assigning Work Array, Two Pointers, Greedy
- Push Dominoes String, Two Pointers, Dynamic Programming
- Longest Mountain in Array Array, Two Pointers, Dynamic Programming
- Partition Array Such That Maximum Difference Is K Array, Greedy, Sorting
- Sort Transformed Array Array, Two Pointers, Math
- Bag of Tokens Array, Two Pointers, Greedy
- Max Number of K-Sum Pairs Array, Two Pointers, Hash Table
- 4Sum Array, Two Pointers, Sorting
- Maximum Distance Between a Pair of Values Array, Two Pointers, Binary Search
- Sum of Square Numbers Math, Two Pointers, Binary Search
- Maximum OR Bit Manipulation, Array, Greedy
- Minimum Array End Bit Manipulation, Greedy
- Number of Wonderful Substrings Bit Manipulation, Hash Table, String
- Bitwise ORs of Subarrays Bit Manipulation, Array, Dynamic Programming
- Find the Longest Substring Containing Vowels in Even Counts Bit Manipulation, Hash Table, String
- Longest Nice Subarray Bit Manipulation, Array, Sliding Window
- UTF-8 Validation Bit Manipulation, Array
- Maximum XOR for Each Query Bit Manipulation, Array, Prefix Sum
- Count Number of Maximum Bitwise-OR Subsets Bit Manipulation, Backtracking, Enumeration
- XOR Queries of a Subarray Bit Manipulation, Array, Prefix Sum
- Decode XORed Permutation Bit Manipulation, Array, Brainteaser
- Minimize XOR Bit Manipulation, Greedy
- Flip String to Monotone Increasing String, Dynamic Programming, Bit Manipulation
- Find the Xor-Beauty of Array Bit Manipulation, Array, Math
- Maximum XOR After Operations Bit Manipulation, Array, Brainteaser
- Longest Subarray With Maximum Bitwise AND Bit Manipulation, Array, Brainteaser
- Minimum Number of Operations to Make Array XOR Equal to K Bit Manipulation, Array
- Find The Original Array of Prefix Xor Bit Manipulation, Array, Prefix Sum
- Bitwise XOR of All Pairings Bit Manipulation, Array, Brainteaser
- Minimum Time to Repair Cars Array, Binary Search, Greedy
- Maximum Value of an Ordered Triplet I Array, Math, Prefix Sum
- Super Ugly Number Dynamic Programming, Math, Heap
- Minimum Moves to Reach Target Score Math, Greedy
- Integer Replacement Bit Manipulation, Greedy, Dynamic Programming
- Reordered Power of 2 Math, Counting, Enumeration
- Minimum Operations to Reduce an Integer to 0 Bit Manipulation, Greedy, Dynamic Programming
- Maximum Product After K Increments Array, Greedy, Heap
- Prime Subtraction Operation Array, Math, Greedy
- Minimum Number of Operations to Make Array Empty Hash Table, Greedy, Counting
- Number of Zero-Filled Subarrays Array, Math, Counting
- 4Sum II Hash Table, Array, Counting
- Find Players With Zero or One Losses Hash Table, Array, Sorting
- Minimum Area Rectangle Hash Table, Array, Geometry
- Number of Boomerangs Hash Table, Math, Array
- Group the People Given the Group Size They Belong To Hash Table, Array, Greedy
- Optimal Partition of String Hash Table, String, Greedy
- Count Number of Bad Pairs Hash Table, Array, Counting
- Determine if Two Strings Are Close Hash Table, String, Counting
- Brick Wall Hash Table, Array, Counting
- Smallest String With Swaps Union Find, Hash Table, String
- Number of Pairs of Interchangeable Rectangles Array, Hash Table, Math
- Count Nice Pairs in an Array Array, Hash Table, Math
- Longest Well-Performing Interval Array, Hash Table, Prefix Sum
- Subarray Sums Divisible by K Array, Hash Table, Prefix Sum
- Maximum Number of Integers to Choose From a Range I Hash Table, Greedy, Binary Search
- Short Encoding of Words String, Trie, Hash Table
- Replace Words String, Trie, Hash Table
- Longest Word in Dictionary String, Trie, Hash Table
- Word Subsets String, Hash Table, Counting
- Number of Good Ways to Split a String String, Hash Table, Prefix Sum
- Can Convert String in K Moves String, Hash Table, Greedy
- Longest Substring With At Least K Repeating Characters String, Sliding Window, Divide and Conquer
- Maximum Number of Occurrences of a Substring String, Sliding Window, Hash Table
- Number of Ways to Split a String String, Math, Counting
- Minimum Number of Frogs Croaking String, Greedy, Counting
- Count Substrings That Differ by One Character String, Dynamic Programming
- Maximum Length of a Concatenated String With Unique Characters String, Bit Manipulation, Backtracking
- Count Words Obtained After Adding a Letter String, Bit Manipulation, Hash Table
- Longest Word in Dictionary Through Deleting String, Two Pointers, Sorting
- Number of Matching Subsequences String, Two Pointers, Binary Search
- Find and Replace Pattern String, Hash Table
- Count Number of Teams Array, Dynamic Programming
- Uncrossed Lines Array, Dynamic Programming
- Minimum ASCII Delete Sum for Two Strings String, Dynamic Programming
- Unique Binary Search Trees Dynamic Programming, Math
- Domino and Tromino Tiling Dynamic Programming
- Paint Fence Dynamic Programming
- Reach a Number Math, Binary Search
- Check if Number is a Sum of Powers of Three Math, Number Theory
- Number of Steps to Reduce a Number in Binary Representation to One String, Bit Manipulation, Simulation
- Find Original Array From Doubled Array Array, Greedy, Sorting
- Non-decreasing Array Array, Greedy
- Minimum Moves to Equal Array Elements II Array, Math, Sorting
- Word Search Array, String, Backtracking
- Pacific Atlantic Water Flow Array, Depth-First Search, Breadth-First Search
- Snakes and Ladders Array, Breadth-First Search, Matrix
- Minimum Genetic Mutation Hash Table, String, Breadth-First Search
- Jump Game III Array, Depth-First Search, Breadth-First Search
- Count Unreachable Pairs of Nodes in an Undirected Graph Depth-First Search, Breadth-First Search, Union Find
- Maximum Total Importance of Roads Graph, Greedy, Sorting
- Find Closest Node to Given Two Nodes Depth-First Search, Graph
- Maximal Network Rank Graph
- Path With Minimum Effort Array, Binary Search, Depth-First Search
- Time Needed to Inform All Employees Tree, Depth-First Search, Breadth-First Search
- Reorder Routes to Make All Paths Lead to the City Zero Depth-First Search, Breadth-First Search, Graph
- Possible Bipartition Depth-First Search, Breadth-First Search, Union Find
- Minimum Height Trees Depth-First Search, Breadth-First Search, Graph
- Detect Cycles in 2D Grid Array, Depth-First Search, Breadth-First Search
- Number of Distinct Islands Array, Hash Table, Depth-First Search
- Shortest Bridge Array, Depth-First Search, Breadth-First Search
- The Earliest Moment When Everyone Become Friends Array, Union Find, Sorting
- Number of Operations to Make Network Connected Depth-First Search, Breadth-First Search, Union Find
- Count Sub Islands Array, Depth-First Search, Breadth-First Search
- As Far from Land as Possible Array, Dynamic Programming, Breadth-First Search
- Shortest Path in Binary Matrix Array, Breadth-First Search, Matrix
- Number of Enclaves Array, Depth-First Search, Breadth-First Search
- Minimum Number of Vertices to Reach All Nodes Graph
- Find Eventual Safe States Depth-First Search, Breadth-First Search, Graph
- All Paths From Source to Target Backtracking, Depth-First Search, Breadth-First Search
- Keys and Rooms Depth-First Search, Breadth-First Search, Graph
- Is Graph Bipartite? Depth-First Search, Breadth-First Search, Union Find
- Graph Valid Tree Depth-First Search, Breadth-First Search, Union Find
- Number of Connected Components in an Undirected Graph Depth-First Search, Breadth-First Search, Union Find
- Rotate Function Array, Math, Dynamic Programming
- Nth Digit Math, Binary Search
- Bulb Switcher Math, Brainteaser
- Count Triplets That Can Form Two Arrays of Equal XOR Array, Hash Table, Math
- Concatenation of Consecutive Binary Numbers Math, Bit Manipulation, Simulation
- Maximum Product of Word Lengths Array, String, Bit Manipulation
- Sort Integers by The Power Value Dynamic Programming, Memoization, Sorting
- Minimum Flips to Make a OR b Equal to c Bit Manipulation
- Gray Code Math, Backtracking, Bit Manipulation
- Maximum XOR of Two Numbers in an Array Array, Hash Table, Bit Manipulation
- Bitwise AND of Numbers Range Bit Manipulation
- Total Hamming Distance Array, Math, Bit Manipulation
- Single Number III Array, Bit Manipulation
- Single Number II Array, Bit Manipulation
- Minimum Insertions to Balance a Parentheses String String, Stack, Greedy
- Remove All Adjacent Duplicates in String II String, Stack
- The Number of Weak Characters in the Game Array, Greedy, Sorting
- Maximum Score From Removing Substrings String, Stack, Greedy
- Minimum Number of Swaps to Make the String Balanced String, Stack, Greedy
- Max Chunks To Make Sorted Array, Stack, Greedy
- Sum of Subarray Ranges Array, Stack, Monotonic Stack
- Reveal Cards In Increasing Order Array, Queue, Sorting
- Reverse Substrings Between Each Pair of Parentheses String, Stack
- Basic Calculator II Math, String, Stack
- Validate Stack Sequences Array, Stack, Simulation
- Next Greater Element III Math, Two Pointers, String
- Maximum Width Ramp Array, Stack, Monotonic Stack
- 132 Pattern Array, Binary Search, Stack
- Sum of Subarray Minimums Array, Dynamic Programming, Stack
- Check If Word Is Valid After Substitutions String, Stack
- Score of Parentheses String, Stack
- Minimum Remove to Make Valid Parentheses String, Stack
- Minimum Add to Make Parentheses Valid String, Stack, Greedy
- Find K Closest Elements Array, Two Pointers, Binary Search
- Kth Smallest Element in a Sorted Matrix Array, Binary Search, Sorting
- Top K Frequent Words Array, Hash Table, String
- K Closest Points to Origin Array, Math, Divide and Conquer
- Partition Array into Disjoint Intervals Array, Greedy
- Remove Duplicate Letters String, Stack, Greedy
- Monotone Increasing Digits Math, Greedy
- Maximum Swap Math, Greedy
- Valid Triangle Number Array, Two Pointers, Binary Search
- Remove Covered Intervals Array, Greedy, Sorting
- Minimum Deletions to Make Character Frequencies Unique String, Hash Table, Greedy
- Queue Reconstruction by Height Array, Greedy, Sorting
- Two City Scheduling Array, Greedy, Sorting
- Knight Dialer Dynamic Programming
- 2 Keys Keyboard Math, Dynamic Programming
- Maximum Length of Pair Chain Array, Dynamic Programming, Greedy
- Longest Turbulent Subarray Array, Dynamic Programming, Sliding Window
- Number of Dice Rolls With Target Sum Dynamic Programming
- Best Sightseeing Pair Array, Dynamic Programming
- Maximum Sum Circular Subarray Array, Divide and Conquer, Dynamic Programming
- Minimum Cost For Tickets Array, Dynamic Programming
- Longest String Chain Array, Hash Table, Two Pointers
- Combination Sum IV Array, Dynamic Programming
- Ones and Zeroes Array, String, Dynamic Programming
- Last Stone Weight II Array, Dynamic Programming
- Stone Game Array, Math, Dynamic Programming
- Count Numbers with Unique Digits Math, Dynamic Programming, Backtracking
- Integer Break Math, Dynamic Programming
- Perfect Squares Math, Dynamic Programming, Breadth-First Search
- Triangle Array, Dynamic Programming
- Minimum Falling Path Sum Array, Dynamic Programming, Matrix
- Interleaving String String, Dynamic Programming
- Delete Operation for Two Strings String, Dynamic Programming
- Wiggle Subsequence Array, Dynamic Programming, Greedy
- Number of Longest Increasing Subsequence Array, Dynamic Programming, Binary Indexed Tree
- Longest Arithmetic Subsequence of Given Difference Array, Hash Table, Dynamic Programming
- Maximum Length of Repeated Subarray Array, Binary Search, Dynamic Programming
- Best Time to Buy and Sell Stock with Transaction Fee Array, Dynamic Programming, Greedy
- Best Time to Buy and Sell Stock with Cooldown Array, Dynamic Programming
- Delete and Earn Array, Hash Table, Dynamic Programming
- Valid Sudoku Array, Hash Table, Matrix
- Number of Closed Islands Array, Depth-First Search, Breadth-First Search
- Surrounded Regions Array, Depth-First Search, Breadth-First Search
- Game of Life Array, Matrix, Simulation
- Count Square Submatrices with All Ones Array, Dynamic Programming, Matrix
- Maximal Square Array, Dynamic Programming, Matrix
- Unique Paths II Array, Dynamic Programming, Matrix
- Minimum Path Sum Array, Dynamic Programming, Matrix
- Sort the Matrix Diagonally Array, Sorting, Matrix
- Max Increase to Keep City Skyline Array, Greedy, Matrix
- Diagonal Traverse Array, Matrix, Simulation
- Count Number of Nice Subarrays Array, Hash Table, Math
- Binary Subarrays With Sum Array, Hash Table, Sliding Window
- Maximum Erasure Value Array, Hash Table, Sliding Window
- Minimum Operations to Reduce X to Zero Array, Hash Table, Binary Search
- Longest Subarray of 1's After Deleting One Element Array, Dynamic Programming, Sliding Window
- Continuous Subarray Sum Array, Hash Table, Math
- Contiguous Array Array, Hash Table, Prefix Sum
- Subarray Product Less Than K Array, Sliding Window, Binary Search
- Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold Array, Sliding Window
- Maximum Number of Vowels in a Substring of Given Length String, Sliding Window
- Valid Parenthesis String String, Dynamic Programming, Stack
- String Compression Two Pointers, String
- Count and Say String, Simulation
- Majority Element II Array, Hash Table, Sorting
- Increasing Triplet Subsequence Array, Greedy
- H-Index Array, Sorting, Counting Sort
- Shortest Unsorted Continuous Subarray Array, Two Pointers, Sorting
- Next Permutation Array, Two Pointers
- Find All Duplicates in an Array Array, Hash Table
- Factorial Trailing Zeroes Math
- Count Primes Math, Sieve of Eratosthenes
Hard (139)
- Count Ways to Make Array With Product Array, Math, Dynamic Programming
- Count the Number of Ideal Arrays Math, Dynamic Programming, Combinatorics
- Number of Ways to Rearrange Sticks With K Sticks Visible Math, Dynamic Programming, Combinatorics
- The Number of Good Subsets Array, Math, Dynamic Programming
- Number of Ways to Reorder Array to Get Same BST Array, Math, Divide and Conquer
- Make Array Strictly Increasing Array, Binary Search, Dynamic Programming
- Odd Even Jump Array, Dynamic Programming, Stack
- Maximum Number of Events That Can Be Attended II Array, Binary Search, Dynamic Programming
- Minimum Replacements to Sort the Array Array, Math, Greedy
- Create Sorted Array Through Instructions Array, Binary Search, Divide and Conquer
- Painting the Walls Array, Dynamic Programming
- Reverse Pairs Array, Binary Search, Divide and Conquer
- Number of Ways to Separate Numbers String, Dynamic Programming, Suffix Array
- Painting a Grid With Three Different Colors Dynamic Programming, Bitmask
- Minimum Incompatibility Array, Dynamic Programming, Bit Manipulation
- Number of Distinct Roll Sequences Dynamic Programming, Memoization
- Form Largest Integer With Digits That Add up to Target Array, String, Dynamic Programming
- Build Array Where You Can Find The Maximum Exactly K Comparisons Dynamic Programming, Prefix Sum
- Stone Game VIII Array, Math, Dynamic Programming
- Allocate Mailboxes Array, Math, Dynamic Programming
- Constrained Subsequence Sum Array, Dynamic Programming, Queue
- Restore the Array String, Dynamic Programming
- Count All Valid Pickup and Delivery Options Math, Dynamic Programming, Combinatorics
- Maximum Height by Stacking Cuboids Array, Dynamic Programming, Sorting
- Cherry Pickup II Array, Dynamic Programming, Matrix
- Strange Printer String, Dynamic Programming
- Number of Ways to Stay in the Same Place After Some Steps Dynamic Programming
- Maximum Value of K Coins From Piles Array, Dynamic Programming, Prefix Sum
- Count Special Integers Math, Dynamic Programming, Combinatorics
- Number of Great Partitions Array, Dynamic Programming
- Minimum Cost to Split an Array Array, Hash Table, Dynamic Programming
- Paths in Matrix Whose Sum Is Divisible by K Array, Dynamic Programming, Matrix
- Special Binary String String, Recursion, Divide and Conquer
- Count Different Palindromic Subsequences String, Dynamic Programming
- Smallest K-Length Subsequence With Occurrences of a Letter String, Stack, Greedy
- Valid Palindrome III String, Dynamic Programming
- Count Anagrams Hash Table, Math, String
- String Compression II String, Dynamic Programming
- Apply Operations to Maximize Score Array, Math, Stack
- Meeting Rooms III Array, Sorting, Simulation
- Smallest Range Covering Elements from K Lists Array, Hash Table, Greedy
- Minimize Deviation in Array Array, Greedy, Heap (Priority Queue)
- Maximum Performance of a Team Array, Greedy, Sorting
- Construct Target Array With Multiple Sums Array, Heap (Priority Queue), Math
- Minimum Number of Operations to Make Array Continuous Array, Hash Table, Binary Search
- Put Marbles in Bags Array, Greedy, Sorting
- Minimum Time to Visit a Cell In a Grid Array, Matrix, Graph
- Minimum Number of Days to Disconnect Island Array, Matrix, Depth-First Search
- Number of Increasing Paths in a Grid Array, Matrix, Dynamic Programming
- Checking Existence of Edge Length Limited Paths Array, Union Find, Graph
- Find All People With Secret Graph, Union Find, Depth-First Search
- Minimum Obstacle Removal to Reach Corner Array, Matrix, Graph
- Number of Good Paths Array, Tree, Graph
- Largest Component Size by Common Factor Array, Math, Union Find
- Critical Connections in a Network Graph, Depth-First Search, Biconnected Component
- Bus Routes Array, Hash Table, Breadth-First Search
- Number of Restricted Paths From First to Last Node Graph, Dynamic Programming, Shortest Path
- Sliding Puzzle Array, Matrix, Breadth-First Search
- Jump Game IV Array, Hash Table, Breadth-First Search
- Trapping Rain Water II Array, Matrix, Heap (Priority Queue)
- Escape the Spreading Fire Array, Matrix, Binary Search
- Grid Illumination Array, Hash Table, Matrix
- Shortest Distance from All Buildings Array, Matrix, Breadth-First Search
- Minimum Moves to Spread Stones Over Grid Array, Matrix, Dynamic Programming
- Making A Large Island Array, Matrix, Depth-First Search
- Unique Paths III Array, Matrix, Backtracking
- Number of Submatrices That Sum to Target Array, Matrix, Hash Table
- Longest Increasing Path in a Matrix Array, Matrix, Dynamic Programming
- Maximal Rectangle Array, Matrix, Stack
- Minimum Difficulty of a Job Schedule Array, Dynamic Programming
- Minimum Cost to Cut a Stick Array, Dynamic Programming, Sorting
- Minimum White Tiles After Covering With Carpets String, Dynamic Programming, Prefix Sum
- Maximum Number of Groups With Increasing Length Array, Greedy, Sorting
- Number of Ways to Earn Points Array, Dynamic Programming
- Scramble String String, Dynamic Programming
- Number of Music Playlists Math, Dynamic Programming, Combinatorics
- Profitable Schemes Array, Dynamic Programming
- Distinct Subsequences II String, Dynamic Programming
- Cherry Pickup Array, Matrix, Dynamic Programming
- Number of Ways to Paint N × 3 Grid Dynamic Programming
- Tallest Billboard Array, Dynamic Programming
- Best Time to Buy and Sell Stock IV Array, Dynamic Programming
- Burst Balloons Array, Dynamic Programming
- Frog Jump Array, Hash Table, Dynamic Programming
- Minimum Falling Path Sum II Array, Matrix, Dynamic Programming
- Dungeon Game Array, Matrix, Dynamic Programming
- Minimum Time to Complete All Tasks Array, Greedy, Sorting
- Minimum Number of Refueling Stops Array, Greedy, Dynamic Programming
- IPO Array, Greedy, Sorting
- Minimum Number of Taps to Open to Water a Garden Array, Greedy, Dynamic Programming
- Maximum Number of Tasks You Can Assign Array, Binary Search, Greedy
- Find the Kth Smallest Sum of a Matrix With Sorted Rows Array, Matrix, Binary Search
- Russian Doll Envelopes Array, Binary Search, Dynamic Programming
- Maximum Running Time of N Computers Array, Binary Search, Greedy
- Minimum Time to Complete Trips Array, Binary Search
- Kth Smallest Number in Multiplication Table Math, Binary Search
- Split Array Largest Sum Array, Binary Search, Greedy
- Minimum Number of Flips to Make the Binary String Alternating String, Sliding Window, Dynamic Programming
- Take K of Each Character From Left and Right String, Hash Table, Sliding Window
- Minimum Number of K Consecutive Bit Flips Array, Sliding Window, Prefix Sum
- Shortest Subarray with Sum at Least K Array, Prefix Sum, Sliding Window
- Count Subarrays With Fixed Bounds Array, Sliding Window, Two Pointers
- Maximum Number of Robots Within Budget Array, Sliding Window, Two Pointers
- Minimum Window Subsequence String, Two Pointers, Dynamic Programming
- Minimum Number of Moves to Make Palindrome String, Two Pointers, Greedy
- Find K-th Smallest Pair Distance Array, Two Pointers, Binary Search
- Subarrays with K Different Integers Array, Hash Table, Sliding Window
- Shortest Path Visiting All Nodes Bit Manipulation, Breadth-First Search, Graph
- Count the Number of Square-Free Subsets Bit Manipulation, Dynamic Programming, Bitmask
- Maximum AND Sum of Array Bit Manipulation, Dynamic Programming, Bitmask
- Find Subarray With Bitwise OR Closest to K Bit Manipulation, Array, Binary Search
- Minimum One Bit Operations to Make Integers Zero Bit Manipulation, Math, Dynamic Programming
- Smallest Good Base Math, Binary Search, Number Theory
- Number of Digit One Math, Digit DP, Recursion
- Preimage Size of Factorial Zeroes Function Math, Binary Search, Number Theory
- Nth Magical Number Math, Binary Search, Number Theory
- Largest Multiple of Three Array, Greedy, Dynamic Programming
- Count of Range Sum Fenwick Tree, Divide and Conquer, Prefix Sum
- Substring with Concatenation of All Words Hash Table, String, Sliding Window
- Max Points on a Line Hash Table, Math, Geometry
- Longest Happy Prefix String, KMP, Rolling Hash
- Count Unique Characters of All Substrings of a Given String String, Hash Table, Counting
- Shortest Palindrome String, KMP, Rolling Hash
- Max Value of Equation Array, Monotonic Queue, Sliding Window
- Count of Smaller Numbers After Self Array, Fenwick Tree, Divide and Conquer
- Stone Game IV Math, Dynamic Programming, Game Theory
- Stone Game III Array, Dynamic Programming, Game Theory
- Palindrome Partitioning II String, Dynamic Programming
- Wildcard Matching String, Dynamic Programming, Greedy
- Distinct Subsequences String, Dynamic Programming
- Max Dot Product Between Two Subsequences Array, Dynamic Programming
- Minimum Insertion Steps to Make a String Palindrome String, Dynamic Programming
- Swim in Rising Water Array, Binary Search, Depth-First Search
- Word Ladder Hash Table, String, Breadth-First Search
- Longest Cycle in a Graph Depth-First Search, Graph, Topological Sort
- Number of Visible People in a Queue Array, Stack, Monotonic Stack
- Longest Valid Parentheses String, Dynamic Programming, Stack
- Count Vowels Permutation Dynamic Programming
- Best Time to Buy and Sell Stock III Array, Dynamic Programming
Topics Google asks most
- Arrays 372 problems
- Dynamic Programming 155 problems
- Strings 150 problems
- Hash Table 109 problems
- Greedy 108 problems
- Math 105 problems
- Sorting 92 problems
- Matrix 72 problems
- Binary Search 71 problems
- Breadth-First Search 57 problems
- Bit Manipulation 55 problems
- Two Pointers 52 problems