Google Hash Table Questions

439 hash table problems asked at Google interviews

Easy (116)Medium (246)Hard (77)

Questions

TitleDifficulty
Two SumEasy
Longest Substring Without Repeating CharactersMedium
Longest Consecutive SequenceMedium
Roman to IntegerEasy
LRU CacheMedium
Majority ElementEasy
Subarray Sum Equals KMedium
First Missing PositiveHard
Group AnagramsMedium
Isomorphic StringsEasy
Contains Duplicate IIEasy
Valid AnagramEasy
Missing NumberEasy
Find All Numbers Disappeared in an ArrayEasy
Fruit Into BasketsMedium
Letter Combinations of a Phone NumberMedium
Valid SudokuMedium
Sudoku SolverHard
Set Matrix ZeroesMedium
Word BreakMedium
Linked List CycleEasy
Happy NumberEasy
Contains DuplicateEasy
Top K Frequent ElementsMedium
Intersection of Two ArraysEasy
Insert Delete GetRandom O(1)Medium
Longest Repeating Character ReplacementMedium
Meeting Rooms IIIHard
Minimum Area RectangleMedium
Delete Nodes And Return ForestMedium
Unique Number of OccurrencesEasy
Count Number of Trapezoids IIHard
Count Number of Trapezoids IMedium
Integer to RomanMedium
Clone GraphMedium
Copy List with Random PointerMedium
Fraction to Recurring DecimalMedium
First Unique Character in a StringEasy
Find the DifferenceEasy
Sliding Window MedianHard
Next Greater Element IEasy
Top K Frequent WordsMedium
Bus RoutesHard
Binary Subarrays With SumMedium
Rank Transform of an ArrayEasy
Tuple with Same ProductMedium
Find the Difference of Two ArraysEasy
Check If N and Its Double ExistEasy
Unique Length-3 Palindromic SubsequencesMedium
Detect SquaresMedium
Find All Possible Recipes from Given SuppliesMedium
Design a Number Container SystemMedium
Find Longest Special Substring That Occurs Thrice IMedium
Delete Nodes From Linked List Present in ArrayMedium
Substring with Concatenation of All WordsHard
Minimum Window SubstringHard
Construct Binary Tree from Preorder and Inorder TraversalMedium
Word LadderHard
Word Break IIHard
Linked List Cycle IIMedium
Intersection of Two Linked ListsEasy
Implement Trie (Prefix Tree)Medium
Majority Element IIMedium
Intersection of Two Arrays IIEasy
Ransom NoteEasy
Longest PalindromeEasy
Maximum XOR of Two Numbers in an ArrayMedium
Find All Anagrams in a StringMedium
Find All Duplicates in an ArrayMedium
Sort Characters By FrequencyMedium
LFU CacheHard
Contiguous ArrayMedium
Permutation in StringMedium
Task SchedulerMedium
Find Duplicate SubtreesMedium
Accounts MergeMedium
Reorganize StringMedium
Number of Matching SubsequencesMedium
Find And Replace in StringMedium
Regions Cut By SlashesMedium
Minimum Area Rectangle IIMedium
Vertical Order Traversal of a Binary TreeHard
Subarrays with K Different IntegersHard
Snapshot ArrayMedium
Longest Arithmetic Subsequence of Given DifferenceMedium
Number of Good PairsEasy
Find X-Sum of All K-Long Subarrays IEasy
Find Missing and Repeated ValuesEasy
Word PatternEasy
Perfect RectangleHard
Encode and Decode TinyURLMedium
Set MismatchEasy
Implement Magic DictionaryMedium
Employee ImportanceMedium
Shortest Completing WordEasy
Pyramid Transition MatrixMedium
Linked List ComponentsMedium
Similar String GroupsHard
Magic Squares In GridMedium
K-Similar StringsHard
All Nodes Distance K in Binary TreeMedium
Random Pick with BlacklistHard
Random Flip MatrixMedium
Construct Binary Tree from Preorder and Postorder TraversalMedium
Online ElectionMedium
X of a Kind in a Deck of CardsEasy
Word SubsetsMedium
Unique Email AddressesEasy
Most Stones Removed with Same Row or ColumnMedium
Largest Component Size by Common FactorHard
Array of Doubled PairsMedium
Find the Town JudgeEasy
Smallest Integer Divisible by KMedium
Binary String With Substrings Representing 1 To NMedium
Longest Arithmetic SubsequenceMedium
Longest String ChainMedium
Letter Tile PossibilitiesMedium
Largest Values From LabelsMedium
Brace Expansion IIHard
Alphabet Board PathMedium
Compare Strings by Frequency of the Smallest CharacterMedium
Find Elements in a Contaminated Binary TreeMedium
Jump Game IVHard
Number of Substrings Containing All Three CharactersMedium
Rank Teams by VotesMedium
Check If a String Contains All Binary Codes of Size KMedium
People Whose List of Favorite Companies Is Not a Subset of Another ListMedium
Find Two Non-overlapping Sub-arrays Each With Target SumMedium
Number of Good Ways to Split a StringMedium
Maximum Number of Non-Overlapping Subarrays With Sum Equals TargetMedium
Find Latest Group of Size MMedium
Split a String Into the Max Number of Unique SubstringsMedium
Throne InheritanceMedium
Arithmetic SubarraysMedium
Distribute Repeating IntegersHard
Minimum Operations to Reduce X to ZeroMedium
Max Number of K-Sum PairsMedium
Minimum Operations to Make a SubsequenceHard
Change Minimum Characters to Satisfy One of Three ConditionsMedium
Evaluate the Bracket Pairs of a StringMedium
Largest Color Value in a Directed GraphHard
Number of Wonderful SubstringsMedium
Describe the PaintingMedium
Operations on TreeMedium
Find Original Array From Doubled ArrayMedium
Stock Price FluctuationMedium
Recover the Original ArrayHard
Count Words Obtained After Adding a LetterMedium
Find All Lonely Numbers in the ArrayMedium
Create Binary Tree From DescriptionsMedium
Most Frequent Number Following Key In an ArrayEasy
Check if Number Has Equal Digit Count and Digit ValueEasy
Sender With Largest Word CountMedium
First Letter to Appear TwiceEasy
Shortest Impossible Sequence of RollsHard
Merge Similar ItemsEasy
Number of Good PathsHard
Longest Uploaded PrefixMedium
Count Number of Distinct Integers After Reverse OperationsMedium
Count Subarrays With Median KHard
Make Number of Distinct Characters EqualMedium
Merge Two 2D Arrays by Summing ValuesEasy
Sum of Imbalance Numbers of All SubarraysHard
Count Pairs of Points With Distance kMedium
Count K-Subsequences of a String With Maximum BeautyHard
Count the Number of Good PartitionsHard
Find Longest Special Substring That Occurs Thrice IIMedium
Most Frequent PrimeMedium
Minimum Number of Operations to Make Word K-PeriodicMedium
Sum of Digit Differences of All PairsMedium
Maximum Number of Ways to Partition an ArrayHard
Construct Binary Tree from Inorder and Postorder TraversalMedium
Word Ladder IIHard
Max Points on a LineHard
Rings and RodsEasy
Repeated DNA SequencesMedium
Number of Flowers in Full BloomHard
Minimum Consecutive Cards to Pick UpMedium
Bulls and CowsMedium
Palindrome PairsHard
Longest Substring with At Least K Repeating CharactersMedium
Number of BoomerangsMedium
Maximum Sum of Distinct Subarrays With Length KMedium
Longest Uncommon Subsequence IIMedium
Continuous Subarray SumMedium
Two Sum IV - Input is a BSTEasy
Split Array into Consecutive SubsequencesMedium
Number of AtomsHard
Jewels and StonesEasy
Rabbits in ForestMedium
Hand of StraightsMedium
Buddy StringsEasy
Fair Candy SwapEasy
Subarray Sums Divisible by KMedium
Time Based Key-Value StoreMedium
Find Common CharactersEasy
Relative Sort ArrayEasy
Count Number of Nice SubarraysMedium
Divide Array in Sets of K Consecutive NumbersMedium
How Many Numbers Are Smaller Than the Current NumberEasy
Avoid Flood in The CityMedium
Sum of Beauty of All SubstringsMedium
Maximum Good Subarray SumMedium
All O`one Data StructureHard
Find the Maximum Number of Elements in SubsetMedium
Smallest Range Covering Elements from K ListsHard
Check if DFS Strings Are PalindromesHard
Sum of Good SubsequencesHard
Finding 3-Digit Even NumbersEasy
Count Special SubsequencesMedium
Design Task ManagerMedium
Count Number of Bad PairsMedium
Longest Harmonious SubsequenceEasy
Minimum Pair Removal to Sort Array IEasy
Path Existence Queries in a Graph IMedium
Number of Equivalent Domino PairsEasy
Partition StringMedium
Maximum Erasure ValueMedium
Reordered Power of 2Medium
Count Caesar Cipher PairsMedium
Longest Balanced Subarray IIHard
Data Stream as Disjoint IntervalsHard
4Sum IIMedium
Brick WallMedium
Find Duplicate File in SystemMedium
Stickers to Spell WordHard
Most Common WordEasy
Binary Trees With FactorsMedium
Number of Submatrices That Sum to TargetHard
Minimum Number of Steps to Make Two Strings AnagramMedium
HTML Entity ParserMedium
Path CrossingEasy
Minimum Deletions to Make Character Frequencies UniqueMedium
Design an Ordered StreamEasy
Count Nice Pairs in an ArrayMedium
Delete Duplicate Folders in SystemHard
Find Unique Binary StringMedium
Count Number of Pairs With Absolute Difference KEasy
Minimum Number of Operations to Make Array ContinuousHard
Longest Palindrome by Concatenating Two Letter WordsMedium
Most Frequent Even ElementEasy
Minimum Common ValueEasy
The Number of Beautiful SubsetsMedium
Convert an Array Into a 2D Array With ConditionsMedium
Extra Characters in a StringMedium
Find the Longest Equal SubarrayMedium
Length of Longest Subarray With at Most K FrequencyMedium
Right TrianglesMedium
Ugly Number IIMedium
Equal Row and Column PairsMedium
Design a Food Rating SystemMedium
Number of Arithmetic TripletsEasy
Longest Ideal SubsequenceMedium
Amount of Time for Binary Tree to Be InfectedMedium
Optimal Partition of StringMedium
Largest Positive Integer That Exists With Its NegativeEasy
Remove Letter To Equalize FrequencyEasy
Keyboard RowEasy
K-diff Pairs in an ArrayMedium
Replace WordsMedium
Delete and EarnMedium
Open the LockMedium
Design HashSetEasy
Design HashMapEasy
Verifying an Alien DictionaryEasy
Remove Zero Sum Consecutive Nodes from Linked ListMedium
Count the Number of Special Characters IIMedium
Maximum Score Words Formed by LettersHard
Count Triplets That Can Form Two Arrays of Equal XORMedium
Least Number of Unique Integers after K RemovalsMedium
Check If Array Pairs Are Divisible by kMedium
Sort Array by Increasing FrequencyEasy
Determine if Two Strings Are CloseMedium
Check if the Sentence Is PangramEasy
Longest Nice SubstringEasy
Kth Distinct String in an ArrayEasy
Prefix and Suffix SearchHard
Basic Calculator IVHard
Count Elements With Maximum FrequencyEasy
Find the Number of Good Pairs IEasy
Sort the PeopleEasy
Count the Number of Consistent StringsEasy
Count the Number of Special Characters IEasy
Find the Longest Substring Containing Vowels in Even CountsMedium
Uncommon Words from Two SentencesEasy
Restore the Array From Adjacent PairsMedium
Find the Length of the Longest Common PrefixMedium
Partition LabelsMedium
Find Winner on a Tic Tac Toe GameEasy
Minimum Genetic MutationMedium
Pairs of Songs With Total Durations Divisible by 60Medium
Distinct Prime Factors of Product of ArrayMedium
Make Sum Divisible by PMedium
Smallest Number in Infinite SetMedium
Sorted GCD Pair QueriesHard
The Number of the Smallest Unoccupied ChairMedium
Tweet Counts Per FrequencyMedium
Cousins in Binary Tree IIMedium
Longest Square Streak in an ArrayMedium
Total Characters in String After Transformations IIHard
Count Substrings With K-Frequency Characters IMedium
Largest Combination With Bitwise AND Greater Than ZeroMedium
Minimum Array Changes to Make Differences EqualMedium
Find Longest Awesome SubstringHard
Take K of Each Character From Left and RightMedium
Flip Columns For Maximum Number of Equal RowsMedium
Reconstruct Original Digits from EnglishMedium
Identify the Largest Outlier in an ArrayMedium
Smallest String With SwapsMedium
Count Pairs That Form a Complete Day IEasy
Design TwitterMedium
Find Score of an Array After Marking All ElementsMedium
Find Maximum Removals From Source StringMedium
Construct String With Repeat LimitMedium
Count the Number of Good SubarraysMedium
Construct K Palindrome StringsMedium
Find the Prefix Common Array of Two ArraysMedium
First Completely Painted Row or ColumnMedium
Max Pair Sum in an ArrayEasy
Swap For Longest Repeated Character SubstringMedium
Count of Interesting SubarraysMedium
Maximum Frequency After Subarray OperationMedium
Check if One String Swap Can Make Strings EqualEasy
Find the Number of Distinct Colors Among the BallsMedium
Minimum Operations to Make Character Frequencies EqualHard
Degree of an ArrayEasy
Max Sum of a Pair With Equal Sum of DigitsMedium
Maximum Total Damage With Spell CastingMedium
Naming a CompanyHard
Sum of Unique ElementsEasy
Sum of DistancesMedium
Length of Longest Fibonacci SubsequenceMedium
Check if All Characters Have Equal Number of OccurrencesEasy
Find the XOR of Numbers Which Appear TwiceEasy
Parse Lisp ExpressionHard
Total Appeal of A StringHard
Insert Delete GetRandom O(1) - Duplicates allowedHard
Simple Bank SystemMedium
Divide Array Into Equal PairsEasy
Count Pairs That Form a Complete Day IIMedium
Minimum Index of a Valid SplitMedium
Lowest Common Ancestor of Deepest LeavesMedium
Minimum Number of Operations to Make Elements in Array DistinctEasy
Make Array Zero by Subtracting Equal AmountsEasy
Encrypt and Decrypt StringsHard
Minimum Operations to Make Array Values Equal to KEasy
Find the Count of Good IntegersHard
Longest Special Path IIHard
Count Vowel Substrings of a StringEasy
Minimize Malware SpreadHard
Custom Sort StringMedium
Count Complete Subarrays in an ArrayMedium
Count Largest GroupEasy
Length of the Longest Valid SubstringHard
Maximum Subarray Sum With Length Divisible by KMedium
Find Most Frequent Vowel and ConsonantEasy
Total Characters in String After Transformations IMedium
Minimum Swaps to Sort by Digit SumMedium
Design Underground SystemMedium
Walking Robot SimulationMedium
3Sum With MultiplicityMedium
Lexicographically Minimum String After Removing StarsMedium
Longest Word in DictionaryMedium
Maximum Difference Between Even and Odd Frequency IEasy
Make the XOR of All Segments Equal to ZeroHard
Count Special QuadrupletsEasy
Unique 3-Digit Even NumbersEasy
Card Flipping GameMedium
Number of Squareful ArraysHard
Minimum Deletions to Make String K-SpecialMedium
Find Maximum Area of a TriangleMedium
Longest Subsequence Repeated k TimesHard
Find Subsequence of Length K With the Largest SumEasy
Non-decreasing SubsequencesMedium
Distribute CandiesEasy
Subdomain Visit CountMedium
Find Lucky Integer in an ArrayEasy
Finding Pairs With a Certain SumMedium
N-Repeated Element in Size 2N ArrayEasy
Split the ArrayEasy
Minimum Time to Collect All Apples in a TreeMedium
Task Scheduler IIMedium
Maximum Unique Subarray Sum After DeletionEasy
Rearranging FruitsHard
Decode the MessageEasy
Increasing Decreasing StringEasy
Maximum Frequency StackHard
Invalid TransactionsMedium
Threshold Majority QueriesHard
Map Sum PairsMedium
Minimum Index Sum of Two ListsEasy
Partition Array Into K-Distinct GroupsMedium
Find Mirror Score of a StringMedium
Smallest Missing Integer Greater Than Sequential Prefix SumEasy
Find Common Elements Between Two ArraysEasy
Minimum Number of People to TeachMedium
Vowel SpellcheckerMedium
Maximum Number of Words You Can TypeEasy
Find the Number of Winning PlayersEasy
Design SpreadsheetMedium
Implement RouterMedium
Design Movie Rental SystemHard
Minimize String LengthEasy
The Two Sneaky Numbers of DigitvilleEasy
Group the People Given the Group Size They Belong ToMedium
Find Resultant Array After Removing AnagramsEasy
Split Array With Same AverageHard
Sum of Perfect Square AncestorsHard
Next Greater Numerically Balanced NumberMedium
Lexicographically Smallest Permutation Greater Than TargetMedium
Find and Replace PatternMedium
Find X-Sum of All K-Long Subarrays IIHard
Power Grid MaintenanceMedium
Minimum Operations to Convert All Elements to ZeroMedium
Keep Multiplying Found Values by TwoEasy
Escape a Large MazeHard
Find the Largest Almost Missing IntegerEasy
Count Special TripletsMedium
Unique Morse Code WordsEasy
Count Covered BuildingsMedium
Coupon Code ValidatorEasy
Two-Letter Card GameMedium
Find Missing ElementsEasy
Find Valid Pair of Adjacent Digits in StringEasy
Minimum Deletions for At Most K Distinct CharactersEasy
Smallest Subtree with all the Deepest NodesMedium
Count Residue PrefixesEasy
Merge BSTs to Create Single BSTHard
Dinner Plate StacksHard
Maximum Square Area by Removing Fences From a FieldMedium
Find Words That Can Be Formed by CharactersEasy
Find Players With Zero or One LossesMedium
Design Auction SystemMedium
Minimum Pair Removal to Sort Array IIHard
Divide an Array Into Subarrays With Minimum Cost IIHard
Longest Balanced Subarray IMedium
Longest Balanced Substring IMedium
Longest Balanced Substring IIMedium
Second Largest Digit in a StringEasy

Showing 439 questions