Google Hard Questions

Hard

499 hard problems asked at Google interviews

Top Topics

Questions

TitleDifficulty
Trapping Rain WaterHard
Median of Two Sorted ArraysHard
Minimum Number of Increments on Subarrays to Form a Target ArrayHard
N-QueensHard
Largest Rectangle in HistogramHard
Split Array Largest SumHard
Viewers Turned StreamersHard
Sliding Window MaximumHard
Russian Doll EnvelopesHard
Regular Expression MatchingHard
Number of Visible People in a QueueHard
Find Median from Data StreamHard
Basic CalculatorHard
Maximal RectangleHard
Merge k Sorted ListsHard
Count Number of Trapezoids IIHard
Binary Tree Maximum Path SumHard
First Missing PositiveHard
Sudoku SolverHard
CandyHard
Reverse Nodes in k-GroupHard
Guess the WordHard
Text JustificationHard
Reverse PairsHard
Wildcard MatchingHard
Range ModuleHard
Minimum Window SubstringHard
Finding MK AverageHard
Meeting Rooms IIIHard
Word LadderHard
Burst BalloonsHard
Swim in Rising WaterHard
Longest Valid ParenthesesHard
24 GameHard
Trapping Rain Water IIHard
Longest Increasing Path in a MatrixHard
Serialize and Deserialize Binary TreeHard
Shortest PalindromeHard
Shortest Path in a Grid with Obstacles EliminationHard
LFU CacheHard
Expression Add OperatorsHard
Permutation SequenceHard
Number of Islands IIHard
Race CarHard
Odd Even JumpHard
Lexicographically Smallest Beautiful StringHard
Alien DictionaryHard
Word Search IIHard
Minimum Time to Finish the RaceHard
Substring with Concatenation of All WordsHard
Vertical Order Traversal of a Binary TreeHard
Integer to English WordsHard
Bus RoutesHard
Subarrays with K Different IntegersHard
Count of Smaller Numbers After SelfHard
Next Special Palindrome NumberHard
The Skyline ProblemHard
Height of Binary Tree After Subtree Removal QueriesHard
Minimum Weighted Subgraph With the Required PathsHard
Sum of Distances in TreeHard
Reconstruct ItineraryHard
Minimum Cost to Make at Least One Valid Path in a GridHard
Partition Array Into Two Arrays to Minimize Sum DifferenceHard
Shortest Path Visiting All NodesHard
Time Taken to Cross the DoorHard
Making A Large IslandHard
Word Break IIHard
Find in Mountain ArrayHard
Minimum Interval to Include Each QueryHard
Maximum Sum of 3 Non-Overlapping SubarraysHard
Sliding Window MedianHard
Number of Digit OneHard
K-th Smallest in Lexicographical OrderHard
Best Time to Buy and Sell Stock IIIHard
Robot Room CleanerHard
Design a Text EditorHard
Word Ladder IIHard
Longest Duplicate SubstringHard
Student Attendance Record IIHard
Maximum Number of Ways to Partition an ArrayHard
Create Maximum NumberHard
Painting a Grid With Three Different ColorsHard
Max Points on a LineHard
Palindrome PairsHard
Sum of Good SubsequencesHard
Maximum Score of a Node SequenceHard
Optimal Account BalancingHard
Minimum Cost to Cut a StickHard
Shortest Common SupersequenceHard
Shortest Distance from All BuildingsHard
Parallel Courses IIHard
Maximum Number of K-Divisible ComponentsHard
Stone Game IIIHard
Design Search Autocomplete SystemHard
Find All People With SecretHard
Shortest Subarray with Sum at Least KHard
Distinct SubsequencesHard
Best Time to Buy and Sell Stock IVHard
Minimum Cost to Merge StonesHard
Longest Increasing Subsequence IIHard
Kth Ancestor of a Tree NodeHard
Count of Range SumHard
All O`one Data StructureHard
Cat and MouseHard
Number of Unique Good SubsequencesHard
The Earliest and Latest Rounds Where Players CompeteHard
Number of Flowers in Full BloomHard
Minimum Obstacle Removal to Reach CornerHard
Minimum Distance to Type a Word Using Two FingersHard
Jump Game IVHard
Employee Free TimeHard
Max Sum of Rectangle No Larger Than KHard
Find the Maximum Sequence Value of ArrayHard
Maximum Frequency of an Element After Performing Operations IIHard
Count Non-Decreasing Subarrays After K OperationsHard
Dungeon GameHard
Maximum XOR With an Element From ArrayHard
Cracking the SafeHard
Largest Component Size by Common FactorHard
Build a Matrix With ConditionsHard
Rank Transform of a MatrixHard
Similar String GroupsHard
Stream of CharactersHard
Number of Good PathsHard
Number of AtomsHard
Cherry Pickup IIHard
Tiling a Rectangle with the Fewest SquaresHard
Number of Ways of Cutting a PizzaHard
Frog JumpHard
Cat and Mouse IIHard
Smallest Range Covering Elements from K ListsHard
Find K-th Smallest Pair DistanceHard
Maximum Score of a Good SubarrayHard
Parallel Courses IIIHard
Paths in Matrix Whose Sum Is Divisible by KHard
Patching ArrayHard
Redundant Connection IIHard
Car Fleet IIHard
Checking Existence of Edge Length Limited PathsHard
Count Subarrays With Score Less Than KHard
Perfect RectangleHard
Check if DFS Strings Are PalindromesHard
Smallest Rectangle Enclosing Black PixelsHard
Rearrange String k Distance ApartHard
Max Chunks To Make Sorted IIHard
Minimize Max Distance to Gas StationHard
Minimum Number of Days to Eat N OrangesHard
Palindrome Partitioning IIHard
Longest Balanced Subarray IIHard
Find the Number of Ways to Place People IIHard
Critical Connections in a NetworkHard
Find Minimum in Rotated Sorted Array IIHard
Maximum Employees to Be Invited to a MeetingHard
Read N Characters Given read4 II - Call Multiple TimesHard
Minimum Cost to Hire K WorkersHard
Largest Color Value in a Directed GraphHard
Freedom TrailHard
Reaching PointsHard
Shortest Path to Get All KeysHard
Couples Holding HandsHard
Sum of Prefix Scores of StringsHard
Smallest Good BaseHard
Minimum Window SubsequenceHard
My Calendar IIIHard
K-Similar StringsHard
String TransformationHard
Delete Columns to Make Sorted IIIHard
Minimum Falling Path Sum IIHard
Pizza With 3n SlicesHard
Max Value of EquationHard
Minimum Adjacent Swaps for K Consecutive OnesHard
Count Fertile Pyramids in a LandHard
Numbers With Repeated DigitsHard
Longest Common Suffix QueriesHard
Last Day Where You Can Still CrossHard
Separate Squares IIHard
Basic Calculator IIIHard
Parsing A Boolean ExpressionHard
Maximize Subarray GCD ScoreHard
Number of Ways to Reorder Array to Get Same BSTHard
Maximum AND Sum of ArrayHard
Count K-Subsequences of a String With Maximum BeautyHard
Erect the FenceHard
Super Egg DropHard
Maximum Value of K Coins From PilesHard
Longest Happy PrefixHard
Minimum Time to Remove All Cars Containing Illegal GoodsHard
Closest Binary Search Tree Value IIHard
Number of Beautiful PartitionsHard
Word AbbreviationHard
Kth Smallest Number in Multiplication TableHard
K Empty SlotsHard
Sum of Imbalance Numbers of All SubarraysHard
Bricks Falling When HitHard
Super PalindromesHard
Brace Expansion IIHard
Divide ChocolateHard
Number of Ways to Stay in the Same Place After Some StepsHard
Minimum Cost to Connect Two Groups of PointsHard
Distribute Repeating IntegersHard
Minimum Operations to Make a SubsequenceHard
Maximum Score from Performing Multiplication OperationsHard
Maximum Number of Groups Getting Fresh DonutsHard
Longest Chunked Palindrome DecompositionHard
Profitable SchemesHard
Number of Pairs Satisfying InequalityHard
Distinct Echo SubstringsHard
Strange Printer IIHard
Fancy SequenceHard
Maximum Profit in Job SchedulingHard
Scramble StringHard
Number of Ways to Form a Target String Given a DictionaryHard
Top Three WineriesHard
Find Beautiful Indices in the Given Array IIHard
N-Queens IIHard
Kth Smallest Product of Two Sorted ArraysHard
Find the Count of Monotonic Pairs IHard
Optimize Water Distribution in a VillageHard
Frog Position After T SecondsHard
Minimum Flips in Binary Tree to Get ResultHard
Amount of New Area Painted Each DayHard
Count the Number of Good PartitionsHard
Median Employee SalaryHard
Count Subarrays With Median KHard
Maximize Consecutive Elements in an Array After ModificationHard
Erect the Fence IIHard
Process Restricted Friend RequestsHard
Recover the Original ArrayHard
Minimum White Tiles After Covering With CarpetsHard
Check if There Is a Valid Parentheses String PathHard
Booking Concert Tickets in GroupsHard
Design Video Sharing PlatformHard
Subarray With Elements Greater Than Varying ThresholdHard
Shortest Impossible Sequence of RollsHard
Minimum Unique Word AbbreviationHard
Word SquaresHard
Sort Array by Moving Items to Empty SpaceHard
Minimize Maximum Value in a GridHard
Encode String with Shortest LengthHard
Maximum Vacation DaysHard
Maximum Average Subarray IIHard
Coin PathHard
Transform to ChessboardHard
Random Pick with BlacklistHard
Confusing Number IIHard
Divide Array Into Increasing SequencesHard
String Transforms Into Another StringHard
Minimum Time to Build BlocksHard
Minimum Sum of Values by Dividing ArrayHard
Design SkiplistHard
Form Largest Integer With Digits That Add up to TargetHard
Move Sub-Tree of N-Ary TreeHard
The Most Similar Path in a GraphHard
Check If String Is Transformable With Substring Sort OperationsHard
Count Ways to Distribute CandiesHard
Checking Existence of Edge Length Limited Paths IIHard
Tree of CoprimesHard
Find the Subtasks That Did Not ExecuteHard
Number of Ways to Rearrange Sticks With K Sticks VisibleHard
Minimum Cost to Change the Final Value of ExpressionHard
Minimum Skips to Arrive at Meeting On TimeHard
Number of Stable SubsequencesHard
Special Binary StringHard
Maximum Sum BST in Binary TreeHard
Unique Paths IIIHard
Recover a Tree From Preorder TraversalHard
Maximum Number of Events That Can Be Attended IIHard
Find the Original Typed String IIHard
Serialize and Deserialize N-ary TreeHard
Minimum Number of Refueling StopsHard
Find the Shortest SuperstringHard
Valid NumberHard
Maximize Alternating Sum Using SwapsHard
Remove BoxesHard
Cherry PickupHard
Maximum Running Time of N ComputersHard
Minimum Cost Walk in Weighted GraphHard
Maximize Subarrays After Removing One Conflicting PairHard
Rearranging FruitsHard
Minimum Number of K Consecutive Bit FlipsHard
Number of Submatrices That Sum to TargetHard
Minimum Number of Taps to Open to Water a GardenHard
Department Top Three SalariesHard
Minimum Time to Visit a Cell In a GridHard
Insert Delete GetRandom O(1) - Duplicates allowedHard
Threshold Majority QueriesHard
Number of ZigZag Arrays IHard
Trips and UsersHard
Remove Invalid ParenthesesHard
Count Number of Balanced PermutationsHard
Sum of k-Mirror NumbersHard
Count the Number of Powerful IntegersHard
Paint House IIIHard
IPOHard
Find the Minimum Cost Array PermutationHard
Block Placement QueriesHard
Maximum Score From Grid OperationsHard
Minimum Initial Energy to Finish TasksHard
Jump Game VHard
Max Dot Product of Two SubsequencesHard
Trionic Array IIHard
Count Subarrays With Fixed BoundsHard
Painting the WallsHard
Divide Nodes Into the Maximum Number of GroupsHard
Find the Count of Good IntegersHard
Design Excel Sum FormulaHard
Longest Subsequence Repeated k TimesHard
Count the Number of Ideal ArraysHard
Set Intersection Size At Least TwoHard
Maximum Students Taking ExamHard
Contains Duplicate IIIHard
Nth Magical NumberHard
Maximum Fruits Harvested After at Most K StepsHard
Get the Maximum ScoreHard
Minimum Operations to Make Array Elements ZeroHard
Number of Ways to Assign Edge Weights IIHard
Tallest BillboardHard
Find the Closest PalindromeHard
Escape the Spreading FireHard
Minimum Replacements to Sort the ArrayHard
Second Minimum Time to Reach DestinationHard
Minimum Number of Removals to Make Mountain ArrayHard
Total Characters in String After Transformations IIHard
Maximum Height by Stacking CuboidsHard
Minimum Insertion Steps to Make a String PalindromeHard
Maximize Subarray Sum After Removing All Occurrences of One ElementHard
Maximum Difference Between Even and Odd Frequency IIHard
Apply Operations to Maximize ScoreHard
Count Good Triplets in an ArrayHard
Put Marbles in BagsHard
Find the Occurrence of First Almost Equal SubstringHard
Find the K-th Character in String Game IIHard
Maximize the Minimum Powered CityHard
Distinct Subsequences IIHard
Minimum Number of Operations to Make Array ContinuousHard
Design In-Memory File SystemHard
Minimum Total Distance TraveledHard
Maximum Sum of Subsequence With Non-adjacent ElementsHard
Maximum Number of Visible PointsHard
Replace Non-Coprime Numbers in ArrayHard
Number of Ways to Paint N × 3 GridHard
Process String with Special Operations IIHard
Total Waviness of Numbers in Range IIHard
Number of ZigZag Arrays IIHard
Lexicographically Smallest Generated StringHard
Maximize the Distance Between Points on a SquareHard
Maximize Cyclic Partition ScoreHard
Minimum Cost Path with TeleportationsHard
Maximize Spanning Tree Stability with UpgradesHard
Equal Sum Grid Partition IIHard
Minimum Deletions to Make Array DivisibleHard
Find Nth Smallest Integer With K One BitsHard
Arithmetic Slices II - SubsequenceHard
Constrained Subsequence SumHard
Binary Tree CamerasHard
K Inverse Pairs ArrayHard
Build Array Where You Can Find The Maximum Exactly K ComparisonsHard
Modify Graph Edge WeightsHard
Basic Calculator IVHard
Delete Duplicate Folders in SystemHard
Best Meeting PointHard
Maximum Number of Points From Grid QueriesHard
Find Weighted Median Node in TreeHard
Maximize the Number of Target Nodes After Connecting Trees IIHard
Number of Squareful ArraysHard
Sort Items by Groups Respecting DependenciesHard
Find X-Sum of All K-Long Subarrays IIHard
Longest Cycle in a GraphHard
Strange PrinterHard
Rectangle Area IIHard
Check if the Rectangle Corner Is ReachableHard
Find Minimum Diameter After Merging Two TreesHard
Minimum Difference in Sums After Removal of ElementsHard
Find the String with LCPHard
Check If It Is a Good ArrayHard
Parse Lisp ExpressionHard
Minimum Cost to Reach Destination in TimeHard
Minimum Operations to Equalize Binary StringHard
Minimum Moves to Move a Box to Their Target LocationHard
Find Critical and Pseudo-Critical Edges in Minimum Spanning TreeHard
Robot CollisionsHard
Maximum Performance of a TeamHard
Find the Maximum Sum of Node ValuesHard
Max StackHard
Consecutive Numbers SumHard
Maximum Score Words Formed by LettersHard
Count Palindromic SubsequencesHard
Chalkboard XOR GameHard
Make Array Non-decreasing or Non-increasingHard
Sliding PuzzleHard
Find Building Where Alice and Bob Can MeetHard
Manhattan Distances of All Arrangements of PiecesHard
Number of Distinct Islands IIHard
Total Appeal of A StringHard
Find the Maximum Number of Fruits CollectedHard
Length of Longest V-Shaped Diagonal SegmentHard
Maximum Number of Tasks You Can AssignHard
Longest Special Path IIHard
Minimum One Bit Operations to Make Integers ZeroHard
Maximum Candies You Can Get from BoxesHard
Reducing DishesHard
Allocate MailboxesHard
Find the Minimum Area to Cover All Ones IIHard
Partition Array for Maximum XOR and ANDHard
Divide an Array Into Subarrays With Minimum Cost IIHard
Maximum Profit from Trading Stocks with DiscountsHard
Verbal Arithmetic PuzzleHard
Super Washing MachinesHard
Closest Subsequence SumHard
Find Minimum Time to Finish All JobsHard
Strong Password CheckerHard
Make the XOR of All Segments Equal to ZeroHard
Data Stream as Disjoint IntervalsHard
Count The RepetitionsHard
Maximum Frequency StackHard
Minimum Cost to Make Array EqualHard
Collect Coins in a TreeHard
Minimum Difficulty of a Job ScheduleHard
Apply Operations to Maximize Frequency ScoreHard
Path Existence Queries in a Graph IIHard
Maximum Total Subarray Value IIHard
Human Traffic of StadiumHard
Count Sequences to KHard
Maximum Partition FactorHard
Maximum Subarray Sum After at Most K SwapsHard
Stickers to Spell WordHard
Count All Valid Pickup and Delivery OptionsHard
Remove Max Number of Edges to Keep Graph Fully TraversableHard
Poor PigsHard
Prefix and Suffix SearchHard
Find Maximum Non-decreasing Array LengthHard
Minimum Operations to Make Array Equal to TargetHard
Find the Largest Palindrome Divisible by KHard
Maximum XOR Score Subarray QueriesHard
Find All Good StringsHard
Sorted GCD Pair QueriesHard
Maximum Number of Moves to Kill All PawnsHard
Stone Game VHard
Minimum Operations to Make Character Frequencies EqualHard
Maximum Path Quality of a GraphHard
Smallest Substring With Identical Characters IHard
Encrypt and Decrypt StringsHard
Contain VirusHard
Merge Operations for Minimum Travel TimeHard
Closest Node to Path in TreeHard
Minimize Malware SpreadHard
Length of the Longest Valid SubstringHard
Non-negative Integers without Consecutive OnesHard
String Compression IIHard
Equal Rational NumbersHard
Earliest Second to Mark Indices IIHard
Count Integers in IntervalsHard
Count the Number of Arrays with K Matching Adjacent ElementsHard
The Maze IIIHard
Create Sorted Array through InstructionsHard
Count Different Palindromic SubsequencesHard
Find the K-Sum of an ArrayHard
Minimum Score After Removals on a TreeHard
Minimum Cost to Convert String IIHard
Check If Digits Are Equal in String After Operations IIHard
Sum of Beautiful SubsequencesHard
Find Substring With Given Hash ValueHard
Count The Number of Winning SequencesHard
Maximum Area Rectangle With Point Constraints IIHard
Longest Palindrome After Substring Concatenation IIHard
Split Array With Same AverageHard
Count Substrings Divisible By Last DigitHard
Escape a Large MazeHard
Sum of Perfect Square AncestorsHard
Number of Valid Move Combinations On ChessboardHard
Find the Longest Valid Obstacle Course at Each PositionHard
Find Servers That Handled Most Number of RequestsHard
Make Array EmptyHard
Zuma GameHard
Count the Number of InversionsHard
Dinner Plate StacksHard
Count Paths That Can Form a Palindrome in a TreeHard
Minimum Time to Complete All TasksHard
Minimum Number of Days to Disconnect IslandHard
Restore The ArrayHard
Memoize IIHard
Merge BSTs to Create Single BSTHard
Smallest Divisible Digit Product IIHard
Minimum Pair Removal to Sort Array IIHard
Find the Number of Subsequences With Equal GCDHard
Count Beautiful NumbersHard
Numbers At Most N Given Digit SetHard
Valid Arrangement of PairsHard
Final Array State After K Multiplication Operations IIHard
Minimum Edge Reversals So Every Node Is ReachableHard
Count Stepping Numbers in RangeHard
Find the Sum of the Power of All SubsequencesHard
Maximize Count of Distinct Primes After SplitHard
Minimum Swaps To Make Sequences IncreasingHard
Longest Palindromic Path in GraphHard
Shortest Cycle in a GraphHard
Reachable Nodes In Subdivided GraphHard
Maximum Building HeightHard
Dice Roll SimulationHard

Showing 499 questions