Google Math Questions

388 math problems asked at Google interviews

Easy (111)Medium (185)Hard (92)

Questions

TitleDifficulty
Add Two NumbersMedium
Palindrome NumberEasy
Roman to IntegerEasy
Reverse IntegerMedium
Climbing StairsEasy
Add Two IntegersEasy
Rotate ArrayMedium
Rotate ImageMedium
Plus OneEasy
Pow(x, n)Medium
Happy NumberEasy
Add BinaryEasy
Power of TwoEasy
Basic CalculatorHard
Sqrt(x)Easy
Unique PathsMedium
Count Number of Trapezoids IIHard
Insert Delete GetRandom O(1)Medium
Guess the WordHard
Count PrimesMedium
Fibonacci NumberEasy
Missing NumberEasy
Minimum Area RectangleMedium
Count Number of Trapezoids IMedium
Random Pick with WeightMedium
Divide Two IntegersMedium
Power of ThreeEasy
Integer to RomanMedium
Greatest Common Divisor of StringsEasy
Add StringsEasy
Largest Divisible SubsetMedium
Count Good NumbersMedium
24 GameHard
Perfect SquaresMedium
Fizz BuzzEasy
Minimum Area Rectangle IIMedium
Find Missing and Repeated ValuesEasy
Evaluate Reverse Polish NotationMedium
Sum of Two IntegersMedium
Expression Add OperatorsHard
Permutation SequenceHard
Add DigitsEasy
Multiply StringsMedium
Maximum SwapMedium
Integer to English WordsHard
Nth DigitMedium
Soup ServingsMedium
Fraction to Recurring DecimalMedium
Linked List Random NodeMedium
Type of TriangleEasy
Detonate the Maximum BombsMedium
Excel Sheet Column TitleEasy
Ugly NumberEasy
Count Numbers with Unique DigitsMedium
Predict the WinnerMedium
Largest Triangle AreaEasy
New 21 GameMedium
Number of Digit OneHard
Smallest Integer Divisible by KMedium
Minimum Time DifferenceMedium
K Closest Points to OriginMedium
K-th Symbol in GrammarMedium
Product of the Last K NumbersMedium
Rotated DigitsMedium
Number of Good PairsEasy
Basic Calculator IIMedium
Max Points on a LineHard
Count Special SubsequencesMedium
Count Number of Bad PairsMedium
Water BottlesEasy
Magic Squares In GridMedium
Sort Transformed ArrayMedium
X of a Kind in a Deck of CardsEasy
The kth Factor of nMedium
Stone Game IIIHard
Valid Perfect SquareEasy
Power of FourEasy
Cat and MouseHard
Find the Number of Ways to Place People IMedium
Find Numbers with Even Number of DigitsEasy
Escape The GhostsMedium
Find N Unique Integers Sum up to ZeroEasy
Continuous Subarray SumMedium
Sum of Square NumbersMedium
Count Number of Nice SubarraysMedium
Nim GameEasy
Beautiful ArrayMedium
Largest Component Size by Common FactorHard
Number of Zero-Filled SubarraysMedium
Random Point in Non-overlapping RectanglesMedium
N-th Tribonacci NumberEasy
Factorial Trailing ZeroesMedium
Find the Largest Area of Square Inside Two RectanglesMedium
Cat and Mouse IIHard
Check if Number is a Sum of Powers of ThreeMedium
Car Fleet IIHard
Perfect RectangleHard
Count Number of Distinct Integers After Reverse OperationsMedium
Prime Subtraction OperationMedium
Unique Binary Search TreesMedium
Bulb SwitcherMedium
Find the Number of Ways to Place People IIHard
Find the Punishment Number of an IntegerMedium
Find the K-th Character in String Game IEasy
Water and Jug ProblemMedium
Stone GameMedium
Largest Odd Number in StringEasy
Reaching PointsHard
Line ReflectionMedium
Number of BoomerangsMedium
Smallest Good BaseHard
String TransformationHard
Valid BoomerangEasy
Maximum Number That Sum of the Prices Is Less Than or Equal to KMedium
Queries on Number of Points Inside a CircleMedium
Guess Number Higher or Lower IIMedium
Confusing NumberEasy
Numbers With Repeated DigitsHard
Divisor GameEasy
Basic Calculator IIIHard
Reordered Power of 2Medium
Maximize Subarray GCD ScoreHard
Convert Binary Number in a Linked List to IntegerEasy
Self Dividing NumbersEasy
Number of Ways to Reorder Array to Get Same BSTHard
Minimum Cost to Set Cooking TimeMedium
Count K-Subsequences of a String With Maximum BeautyHard
Erect the FenceHard
Super Egg DropHard
Maximum Split of Positive Even IntegersMedium
Plus One Linked ListMedium
Kth Smallest Number in Multiplication TableHard
Super PalindromesHard
Sum of Digit Differences of All PairsMedium
Find the Minimum Number of Fibonacci Numbers Whose Sum Is KMedium
Simplified FractionsMedium
Beautiful Arrangement IIMedium
Super Ugly NumberMedium
Fancy SequenceHard
Perfect NumberEasy
Integer BreakMedium
Add Two Numbers IIMedium
Find the Maximum Achievable NumberEasy
Different Ways to Add ParenthesesMedium
Rabbits in ForestMedium
Calculate Money in Leetcode BankEasy
Find the Count of Monotonic Pairs IHard
Arranging CoinsEasy
Maximum Area Rectangle With Point Constraints IMedium
4 Keys KeyboardMedium
Circle and Rectangle OverlappingMedium
Find Positive Integer Solution for a Given EquationMedium
Most Frequent PrimeMedium
Count the Number of Good PartitionsHard
Minimum Cost to Make Array EqualindromicMedium
Erect the Fence IIHard
Remove All Ones With Row and Column FlipsMedium
Flip Game IIMedium
Minimum Lines to Represent a Line ChartMedium
Convex PolygonMedium
Transform to ChessboardHard
Similar RGB ColorEasy
Random Pick with BlacklistHard
Random Flip MatrixMedium
Determine if a Cell Is Reachable at a Given TimeMedium
Confusing Number IIHard
Minimum Time to Build BlocksHard
Number of Substrings With Only 1sMedium
Guess the Majority in a Hidden ArrayMedium
Tree of CoprimesHard
Maximum Score From Removing StonesMedium
Minimum Number of Operations to Reinitialize a PermutationMedium
Number of Ways to Rearrange Sticks With K Sticks VisibleHard
Minimum Cost to Change the Final Value of ExpressionHard
Count Caesar Cipher PairsMedium
Rectangle AreaMedium
Subtract the Product and Sum of Digits of an IntegerEasy
Count Odd Numbers in an Interval RangeEasy
Divisible and Non-divisible Sums DifferenceEasy
Number of Steps to Reduce a Number to ZeroEasy
Excel Sheet Column NumberEasy
Count Square Sum TriplesEasy
Next Greater Element IIIMedium
2 Keys KeyboardMedium
Number of Common FactorsEasy
Minimum Moves to Equal Array ElementsMedium
Convert Integer to the Sum of Two No-Zero IntegersEasy
Next Greater Numerically Balanced NumberMedium
Ugly Number IIMedium
Shuffle an ArrayMedium
Maximum Product of Three NumbersEasy
Insert Delete GetRandom O(1) - Duplicates allowedHard
Minimum Number of Operations to Make All Array Elements Equal to 1Medium
Minimum Sensors to Cover GridMedium
Largest Prime from Consecutive Prime SumMedium
Power Update After K-th Largest Insertion IMedium
Angle Between Hands of a ClockMedium
Strictly Palindromic NumberMedium
Minimum Operations to Make Array Sum Divisible by KEasy
Minimum Time Visiting All PointsEasy
Base 7Easy
Implement Rand10() Using Rand7()Medium
Count Number of Balanced PermutationsHard
Count the Number of Square-Free SubsetsMedium
Sum of k-Mirror NumbersHard
Count the Number of Powerful IntegersHard
Smallest Number With All Set BitsEasy
Distribute Candies Among Children IIMedium
Convert a Number to HexadecimalEasy
Count Largest GroupEasy
Largest Perimeter TriangleEasy
Rotate FunctionMedium
Prime PalindromeMedium
Four DivisorsMedium
Day of the YearEasy
Find Greatest Common Divisor of ArrayEasy
Gray CodeMedium
Valid SquareMedium
Fraction Addition and SubtractionMedium
Sum of All Subset XOR TotalsEasy
Number of Sub-arrays With Odd SumMedium
Find the Count of Good IntegersHard
Maximum 69 NumberEasy
Count Operations to Obtain ZeroEasy
The Two Sneaky Numbers of DigitvilleEasy
Count the Number of Ideal ArraysHard
Maximum Value at a Given Index in a Bounded ArrayMedium
Find the Winner of the Circular GameMedium
Nth Magical NumberHard
Reach a NumberMedium
Minimum Moves to Equal Array Elements IIMedium
Minimum Operations to Make Array Elements ZeroHard
Number of Ways to Assign Edge Weights IIHard
Minimum Jumps to Reach End via Prime TeleportationMedium
Smallest Even MultipleEasy
Find the Closest PalindromeHard
Minimum Replacements to Sort the ArrayHard
Pass the PillowEasy
Stone Game IIMedium
Elimination GameMedium
Total Characters in String After Transformations IIHard
Three DivisorsEasy
Minimum Swaps to Make Strings EqualMedium
Reconstruct Original Digits from EnglishMedium
Super PowMedium
Apply Operations to Maximize ScoreHard
Count Symmetric IntegersEasy
Find the K-th Character in String Game IIHard
Alice and Bob Playing Flower GameMedium
Maximum Number of Visible PointsHard
Replace Non-Coprime Numbers in ArrayHard
Find the Pivot IntegerEasy
Construct the RectangleEasy
Can I WinMedium
Add to Array-Form of IntegerEasy
Count of Matches in TournamentEasy
Number of Smooth Descent Periods of a StockMedium
Total Waviness of Numbers in Range IIHard
Number of ZigZag Arrays IIHard
Maximize the Distance Between Points on a SquareHard
Total Waviness of Numbers in Range IMedium
Count Partitions with Even Sum DifferenceEasy
Prime Number of Set Bits in Binary RepresentationEasy
Concatenation of Consecutive Binary NumbersMedium
Get Biggest Three Rhombus Sums in a GridMedium
Minimum Deletions to Make Array DivisibleHard
Concatenate Non-Zero Digits and Multiply by Sum IIMedium
Find Nth Smallest Integer With K One BitsHard
Count the Digits That Divide a NumberEasy
Number of Days Between Two DatesEasy
Maximum Odd Binary NumberEasy
Basic Calculator IVHard
Find Minimum Operations to Make All Elements Divisible by ThreeEasy
Best Meeting PointHard
Max Difference You Can Get From Changing an IntegerMedium
Convert the TemperatureEasy
Minimum Cuts to Divide a CircleEasy
Check If Digits Are Equal in String After Operations IEasy
Count the Number of Computer Unlocking PermutationsMedium
Number of Squareful ArraysHard
Maximum Subarray With Equal ProductsEasy
Check if the Rectangle Corner Is ReachableHard
Minimum Operations to Make a Uni-Value GridMedium
Mirror ReflectionMedium
Check If It Is a Good ArrayHard
Maximum Product of Two DigitsEasy
Minimum Operations to Equalize Binary StringHard
Minimum Element After Replacement With Digit SumEasy
Minimum Operations to Transform Array into Alternating PrimeMedium
Mirror Distance of an IntegerEasy
Minimum Absolute Distance Between Mirror PairsMedium
Construct Uniform Parity Array IEasy
Minimum Number of Pushes to Type Word IEasy
Number of Ways to Reach a Position After Exactly k StepsMedium
Count Number of Homogenous SubstringsMedium
Consecutive Numbers SumHard
Chalkboard XOR GameHard
Day of the WeekEasy
Maximum Difference by Remapping a DigitEasy
Find Triangular Sum of an ArrayMedium
Find the Key of the NumbersEasy
Manhattan Distances of All Arrangements of PiecesHard
Count Total Number of Colored CellsMedium
Sum of All Odd Length SubarraysEasy
Find the Divisibility Array of a StringMedium
Water Bottles IIMedium
Total Characters in String After Transformations IMedium
Stone Game VIIMedium
Minimum One Bit Operations to Make Integers ZeroHard
Vowels Game in a StringMedium
Sum of Absolute Differences in a Sorted ArrayMedium
Allocate MailboxesHard
Partition Array for Maximum XOR and ANDHard
XOR Operation in an ArrayEasy
Count Distinct Integers After Removing ZerosMedium
Egg Drop With 2 Eggs and N FloorsMedium
Verbal Arithmetic PuzzleHard
A Number After a Double ReversalEasy
Find Closest PersonEasy
Broken CalculatorMedium
Calculate Delayed Arrival TimeEasy
Smallest Range IEasy
Difference Between Element Sum and Digit Sum of an ArrayEasy
Matrix Similarity After Cyclic ShiftsEasy
Traffic Signal ColorEasy
Count K-th Roots in a RangeMedium
Count Sequences to KHard
Minimum Number of Seconds to Make Mountain Height ZeroMedium
Number of Pairs of Interchangeable RectanglesMedium
Count All Valid Pickup and Delivery OptionsHard
Poor PigsHard
Count Triplets That Can Form Two Arrays of Equal XORMedium
Double a Number Represented as a Linked ListMedium
Insert Greatest Common Divisors in Linked ListMedium
Find the Largest Palindrome Divisible by KHard
Find Missing ObservationsMedium
Projection Area of 3D ShapesEasy
Sorted GCD Pair QueriesHard
Maximum Number of Moves to Kill All PawnsHard
Minimum Division Operations to Make Array Non DecreasingMedium
Convert Date to BinaryEasy
Stone Game VHard
Final Array State After K Multiplication Operations IEasy
Cells with Odd Values in a MatrixEasy
Find the Number of Copy ArraysMedium
Closest Prime Numbers in RangeMedium
Split With Minimum SumEasy
Equal Rational NumbersHard
Sum of Digits in Base KEasy
Count the Number of Arrays with K Matching Adjacent ElementsHard
Find Maximum Area of a TriangleMedium
Count Prime-Gap Balanced SubarraysMedium
Check If Digits Are Equal in String After Operations IIHard
Sum of Beautiful SubsequencesHard
Solve the EquationMedium
Robot Bounded In CircleMedium
Balanced K-Factor DecompositionMedium
Convert to Base -2Medium
Maximum Area Rectangle With Point Constraints IIHard
Maximum Xor ProductMedium
Distinct Prime Factors of Product of ArrayMedium
Split Array With Same AverageHard
Sum of Perfect Square AncestorsHard
Monotone Increasing DigitsMedium
Minimum Time to Complete All DeliveriesMedium
Maximum Product of Three Elements After One ReplacementMedium
Maximum Containers on a ShipEasy
Smallest Index With Digit Sum Equal to IndexEasy
Append K Integers With Minimal SumMedium
Count Nice Pairs in an ArrayMedium
The Number of Beautiful SubsetsMedium
Right TrianglesMedium
Prime In DiagonalEasy
Smallest Divisible Digit Product IIHard
Count Sorted Vowel StringsMedium
Find the K-Beauty of a NumberEasy
Number of Subarrays With LCM Equal to KMedium
Find the Number of Subsequences With Equal GCDHard
Maximum Number of Groups Entering a CompetitionMedium
GCD of Odd and Even SumsEasy
Distribute Money to Maximum ChildrenEasy
Random Pick IndexMedium
Numbers At Most N Given Digit SetHard
Maximize Sum of Squares of DigitsMedium
Maximize Count of Distinct Primes After SplitHard
Digit Operations to Make Two Integers EqualMedium
Maximum of Absolute Value ExpressionMedium
Maximum Building HeightHard

Showing 388 questions