Google Math Coding Interview Questions
109 math coding problems are tagged as asked at Google in interviews and online assessments reported by candidates. By difficulty they split into 34 basic, 50 intermediate and 25 advanced. The topics they most often combine with are String, Array, Number Theory, Counting.
Reported questions change over time and are not a guarantee of what you will be asked, so use the list to see which patterns Google tends to test. For each problem, practise explaining your approach, its time and space cost and the edge cases before you write the code; every problem opens in an editor that runs your code against test cases.
Coding problems
- Valid Palindrome (Basic)
- Decode Ways (Intermediate)
- Power of Two (Basic)
- Happy Number (Intermediate)
- Count and Say (Intermediate)
- Integer to Roman (Intermediate)
- Power of Three (Basic)
- Count Primes (Intermediate)
- Power of Four (Basic)
- Coin Change Ways (Advanced)
- Target Sum (Advanced)
- Reverse Integer (Intermediate)
- Plus One (Basic)
- Ugly Number (Basic)
- Nim Game (Basic)
- Greatest Common Divisor of Strings (Intermediate)
- Maximum 69 Number (Basic)
- Sum of Subarray Minimums (Advanced)
- Number of Steps to Reduce to Zero (Basic)
- Smallest Even Multiple (Basic)
- Remove K Digits to Get the Smallest Number (Intermediate)
- Count Numbers With Even Digits (Basic)
- Minimum Knight Moves (Intermediate)
- Count Numbers With Unique Digits (Intermediate)
- Coin Change Ways (Intermediate)
- Number of Digit One (Advanced)
- Sum of Subarray Minimums (Advanced)
- Median of Sliding Windows (Intermediate)
- Minimum Number of Perfect Squares (Intermediate)
- Reverse Nodes in Even Length Groups (Intermediate)
- Plus One Linked List (Basic)
- Sum of Root-to-Leaf Binary Numbers (Basic)
- Binary Tree Coloring Game (Intermediate)
- Open the Lock (Intermediate)
- Combination Sum IV (Intermediate)
- Knight Dialer (Intermediate)
- Integer Break (Basic)
- Profitable Schemes (Advanced)
- Count Ways to Distribute Candies (Intermediate)
- Can I Win (Advanced)
- Integer Replacement (Intermediate)
- Count Ways to Build Good Strings (Intermediate)
- Count Special Subsequences (Advanced)
- Valid Number (Advanced)
- String to Integer (Intermediate)
- Integer to English Words (Advanced)
- Validate IP Address (Intermediate)
- Sum of Subarray Ranges (Intermediate)
- Ugly Number II (Intermediate)
- Super Ugly Number (Intermediate)
- Maximum Performance of a Team (Advanced)
- Maximal Score After K Operations (Intermediate)
- Take Gifts From the Richest Pile (Basic)
- Valid Sudoku (Intermediate)
- Bulls and Cows (Intermediate)
- Bag of Tokens (Intermediate)
- Smallest Divisor Given a Threshold (Intermediate)
- Median of Two Sorted Arrays (Advanced)
- Nth Magical Number (Advanced)
- Divide Two Integers (Intermediate)
- Perfect Number (Basic)
- Self Dividing Numbers (Basic)
- Convert to Base -2 (Intermediate)
- Nth Digit (Intermediate)
- Water and Jug Problem (Intermediate)
- Bulb Switcher (Intermediate)
- Poor Pigs (Advanced)
- Mirror Reflection (Intermediate)
- Combination Sum III (Intermediate)
- Sudoku Solver (Advanced)
- Letter Combinations of a Phone Number (Intermediate)
- Restore IP Addresses (Intermediate)
- Expression Add Operators (Advanced)
- Letter Case Permutation (Basic)
- Additive Number (Intermediate)
- Add to Array-Form of Integer (Basic)
- Second Largest Digit in a String (Basic)
- Tree of Coprimes (Advanced)
- K Inverse Pairs Array (Advanced)
- Count the Number of Ideal Arrays (Advanced)
Related
- Google coding interview questions
- Math problems
- Google basic problems
- Google intermediate problems
- Google advanced problems
- Company interview roadmaps
- All interview guides
Frequently asked questions
How should I use the Google problem list?
Start with the basic problems, then the intermediate and advanced ones, and note which topics repeat. Solve each under a timer, then read the explanation.
Are these the exact Google interview questions?
They are problems candidates reported being asked. Companies rotate questions, so use them to learn the patterns, not to predict the exact question.