Advanced Math Problems for Coding Interviews
188 advanced Math problems from real coding interviews, each with test cases you can run online. By difficulty they split into 0 basic, 0 intermediate and 188 advanced. The companies that ask them most often are Google, Amazon, Meta, Microsoft.
Solve a few problems of each level, name the pattern after each one and revisit the ones that needed a hint a week later. Practise stating the time and space complexity and the edge cases before you code.
Coding problems
- Coin Change Ways (Advanced)
- Target Sum (Advanced)
- Largest Number From Digits (Advanced)
- Sum of Subarray Minimums (Advanced)
- Dice Rolls to Reach a Target (Advanced)
- Modular Exponentiation (Advanced)
- Count Shortest Paths (Advanced)
- Count Subsequence Occurrences (Advanced)
- Number of Digit One (Advanced)
- Sum of Subarray Minimums (Advanced)
- Polynomial Multiplication (Advanced)
- Number of Restricted Paths (Advanced)
- Profitable Schemes (Advanced)
- Ways to Stay in the Same Place (Advanced)
- Student Attendance Record Count (Advanced)
- Arithmetic Subsequence Count (Advanced)
- Count Distinct Palindromic Subsequences (Advanced)
- Music Playlists Count (Advanced)
- Numbers From a Digit Set (Advanced)
- Stepping Numbers in Range (Advanced)
- Can I Win (Advanced)
- Minimum Days to Eat Oranges (Advanced)
- Grid Paths Divisible by K (Advanced)
- Pickup and Delivery Orders (Advanced)
- Ways to Reorder Array to Get Same BST (Advanced)
- Number of Ways to Earn Points (Advanced)
- Count Special Subsequences (Advanced)
- Number of Increasing Paths in a Grid (Advanced)
- Valid Number (Advanced)
- Integer to English Words (Advanced)
- Count Unique Characters of All Substrings (Advanced)
- Decoded String at Index (Advanced)
- Maximum Performance of a Team (Advanced)
- Median of Two Sorted Arrays (Advanced)
- Nth Magical Number (Advanced)
- Ugly Number III (Advanced)
- Kth Smallest Prime Fraction (Advanced)
- Poor Pigs (Advanced)
- Sudoku Solver (Advanced)
- Expression Add Operators (Advanced)
- Permutation Rank (Advanced)
- De Bruijn Sequence (Advanced)
- Count Proper K-Colorings (Advanced)
- Count Spanning Trees (Advanced)
- Count Prime Paths in a Tree (Advanced)
- Graph Connectivity With Threshold (Advanced)
- Largest Component by Common Factor (Advanced)
- Tree of Coprimes (Advanced)
- K Inverse Pairs Array (Advanced)
- Rearrange Sticks With K Visible (Advanced)
- Ways to Build Sturdy Brick Wall (Advanced)
- Ways to Build Rooms in an Ant Colony (Advanced)
- Count the Number of Ideal Arrays (Advanced)
- Number of Beautiful Partitions (Advanced)
- Number of Great Partitions (Advanced)
- Sets of K Non-Overlapping Line Segments (Advanced)
- Dice Roll Simulation (Advanced)
- Painting a Grid With Three Different Colors (Advanced)
- Count All Possible Routes (Advanced)
- Ways of Cutting a Pizza (Advanced)
- Count Palindromic Subsequences of Length 5 (Advanced)
- Ways to Separate Numbers (Advanced)
- Restore the Array From Digits (Advanced)
- Ways to Wear Different Hats (Advanced)
- Paths With Max Score (Advanced)
- Largest Integer With Digit Cost Target (Advanced)
- Count Beautiful Integers in Range (Advanced)
- Count Integers Divisible by Their Digit Sum (Advanced)
- Ways to Make Array With Product (Advanced)
- Necklaces With K Colors (Advanced)
- Grid Paths Avoiding Blocked Cells (Advanced)
- DI String Valid Permutations (Advanced)
- Count Distinct Subsequences (Advanced)
- Longest Awesome Substring (Advanced)
- Strong Password Checker (Advanced)
- Maximum Running Time of N Computers (Advanced)
- Sell Diminishing-Valued Colored Balls (Advanced)
- Sum of Total Strength of Wizards (Advanced)
- Maximum Subarray Min-Product (Advanced)
- Sum of GCDs of All Pairs (Advanced)
Related
Frequently asked questions
How do I get good at math problems?
Practise by level, name the pattern after you solve each problem and review the ones you needed hints for. The list is ordered so you can start with the basic ones.
Can I run math problems online here?
Yes. Each problem opens in an editor that runs your code against test cases in Java, Python, C++, Go, JavaScript and more.