preloader
  • Home
  • Previous Questions

Contains previous problem statements given by various recruitors during their selection process.

1st Jan, 0001

Apple

IDQuestions
1Two Sum
2Add Two Numbers
3Longest Substring Without Repeating Characters
4Median of Two Sorted Arrays
5Longest Palindromic Substring
6Zigzag Conversion
7Reverse Integer
8String to Integer (atoi)
9Palindrome Number
10Regular Expression Matching
11Container With Most Water
12Integer to Roman
13Roman to Integer
14Longest Common Prefix
153Sum
163Sum Closest
17Letter Combinations of a Phone Number
184Sum
19Remove Nth Node From End of List
20Valid Parentheses
21Merge Two Sorted Lists
22Generate Parentheses
23Merge k Sorted Lists
24Swap Nodes in Pairs
25Reverse Nodes in k-Group
26Remove Duplicates from Sorted Array
27Remove Element
28Find the Index of the First Occurrence in a String
29Divide Two Integers
30Substring with Concatenation of All Words
31Next Permutation
32Longest Valid Parentheses
33Search in Rotated Sorted Array
34Find First and Last Position of Element in Sorted Array
35Search Insert Position
36Valid Sudoku
37Sudoku Solver
38Count and Say
39Combination Sum
40Combination Sum II
41First Missing Positive
42Trapping Rain Water
43Multiply Strings
44Wildcard Matching
45Jump Game II
46Permutations
47Permutations II
48Rotate Image
49Group Anagrams
50Pow(x, n)
51N-Queens
53Maximum Subarray
54Spiral Matrix
55Jump Game
56Merge Intervals
57Insert Interval
58Length of Last Word
59Spiral Matrix II
61Rotate List
62Unique Paths
63Unique Paths II
64Minimum Path Sum
65Valid Number
66Plus One
67Add Binary
68Text Justification
69Sqrt(x)
70Climbing Stairs
71Simplify Path
72Edit Distance
73Set Matrix Zeroes
74Search a 2D Matrix
75Sort Colors
76Minimum Window Substring
77Combinations
78Subsets
79Word Search
80Remove Duplicates from Sorted Array II
81Search in Rotated Sorted Array II
82Remove Duplicates from Sorted List II
83Remove Duplicates from Sorted List
84Largest Rectangle in Histogram
85Maximal Rectangle
86Partition List
87Scramble String
88Merge Sorted Array
89Gray Code
90Subsets II
91Decode Ways
92Reverse Linked List II
93Restore IP Addresses
94Binary Tree Inorder Traversal
95Unique Binary Search Trees II
96Unique Binary Search Trees
97Interleaving String
98Validate Binary Search Tree
99Recover Binary Search Tree
100Same Tree
101Symmetric Tree
102Binary Tree Level Order Traversal
103Binary Tree Zigzag Level Order Traversal
104Maximum Depth of Binary Tree
105Construct Binary Tree from Preorder and Inorder Traversal
108Convert Sorted Array to Binary Search Tree
109Convert Sorted List to Binary Search Tree
113Path Sum II
114Flatten Binary Tree to Linked List
115Distinct Subsequences
116Populating Next Right Pointers in Each Node
118Pascal’s Triangle
119Pascal’s Triangle II
120Triangle
121Best Time to Buy and Sell Stock
122Best Time to Buy and Sell Stock II
123Best Time to Buy and Sell Stock III
124Binary Tree Maximum Path Sum
125Valid Palindrome
126Word Ladder II
127Word Ladder
128Longest Consecutive Sequence
129Sum Root to Leaf Numbers
130Surrounded Regions
131Palindrome Partitioning
132Palindrome Partitioning II
133Clone Graph
134Gas Station
136Single Number
137Single Number II
138Copy List with Random Pointer
139Word Break
140Word Break II
141Linked List Cycle
142Linked List Cycle II
143Reorder List
144Binary Tree Preorder Traversal
145Binary Tree Postorder Traversal
146LRU Cache
148Sort List
149Max Points on a Line
151Reverse Words in a String
152Maximum Product Subarray
153Find Minimum in Rotated Sorted Array
154Find Minimum in Rotated Sorted Array II
155Min Stack
158Read N Characters Given read4 II - Call Multiple Times
160Intersection of Two Linked Lists
162Find Peak Element
165Compare Version Numbers
167Two Sum II - Input Array Is Sorted
168Excel Sheet Column Title
169Majority Element
171Excel Sheet Column Number
173Binary Search Tree Iterator
174Dungeon Game
175Combine Two Tables
176Second Highest Salary
178Rank Scores
179Largest Number
180Consecutive Numbers
183Customers Who Never Order
184Department Highest Salary
186Reverse Words in a String II
188Best Time to Buy and Sell Stock IV
189Rotate Array
190Reverse Bits
191Number of 1 Bits
193Valid Phone Numbers
196Delete Duplicate Emails
198House Robber
199Binary Tree Right Side View
200Number of Islands
201Bitwise AND of Numbers Range
202Happy Number
203Remove Linked List Elements
204Count Primes
205Isomorphic Strings
206Reverse Linked List
207Course Schedule
208Implement Trie (Prefix Tree)
209Minimum Size Subarray Sum
210Course Schedule II
211Design Add and Search Words Data Structure
212Word Search II
215Kth Largest Element in an Array
216Combination Sum III
217Contains Duplicate
218The Skyline Problem
219Contains Duplicate II
220Contains Duplicate III
221Maximal Square
222Count Complete Tree Nodes
223Rectangle Area
224Basic Calculator
225Implement Stack using Queues
226Invert Binary Tree
227Basic Calculator II
229Majority Element II
230Kth Smallest Element in a BST
231Power of Two
232Implement Queue using Stacks
233Number of Digit One
234Palindrome Linked List
235Lowest Common Ancestor of a Binary Search Tree
236Lowest Common Ancestor of a Binary Tree
237Delete Node in a Linked List
238Product of Array Except Self
239Sliding Window Maximum
240Search a 2D Matrix II
242Valid Anagram
252Meeting Rooms
253Meeting Rooms II
257Binary Tree Paths
258Add Digits
2593Sum Smaller
268Missing Number
269Alien Dictionary
273Integer to English Words
274H-Index
277Find the Celebrity
278First Bad Version
279Perfect Squares
283Move Zeroes
284Peeking Iterator
285Inorder Successor in BST
287Find the Duplicate Number
290Word Pattern
295Find Median from Data Stream
297Serialize and Deserialize Binary Tree
300Longest Increasing Subsequence
301Remove Invalid Parentheses
311Sparse Matrix Multiplication
312Burst Balloons
315Count of Smaller Numbers After Self
316Remove Duplicate Letters
322Coin Change
325Maximum Size Subarray Sum Equals k
326Power of Three
328Odd Even Linked List
329Longest Increasing Path in a Matrix
334Increasing Triplet Subsequence
336Palindrome Pairs
341Flatten Nested List Iterator
342Power of Four
343Integer Break
344Reverse String
345Reverse Vowels of a String
346Moving Average from Data Stream
347Top K Frequent Elements
348Design Tic-Tac-Toe
349Intersection of Two Arrays
350Intersection of Two Arrays II
352Data Stream as Disjoint Intervals
355Design Twitter
357Count Numbers with Unique Digits
359Logger Rate Limiter
362Design Hit Counter
367Valid Perfect Square
368Largest Divisible Subset
371Sum of Two Integers
373Find K Pairs with Smallest Sums
374Guess Number Higher or Lower
376Wiggle Subsequence
377Combination Sum IV
380Insert Delete GetRandom O(1)
381Insert Delete GetRandom O(1) - Duplicates allowed
383Ransom Note
384Shuffle an Array
387First Unique Character in a String
389Find the Difference
392Is Subsequence
393UTF-8 Validation
394Decode String
395Longest Substring with At Least K Repeating Characters
399Evaluate Division
400Nth Digit
402Remove K Digits
407Trapping Rain Water II
409Longest Palindrome
410Split Array Largest Sum
412Fizz Buzz
415Add Strings
416Partition Equal Subset Sum
417Pacific Atlantic Water Flow
419Battleships in a Board
420Strong Password Checker
421Maximum XOR of Two Numbers in an Array
424Longest Repeating Character Replacement
433Minimum Genetic Mutation
435Non-overlapping Intervals
438Find All Anagrams in a String
442Find All Duplicates in an Array
443String Compression
445Add Two Numbers II
448Find All Numbers Disappeared in an Array
450Delete Node in a BST
451Sort Characters By Frequency
452Minimum Number of Arrows to Burst Balloons
455Assign Cookies
456132 Pattern
459Repeated Substring Pattern
460LFU Cache
462Minimum Moves to Equal Array Elements II
463Island Perimeter
465Optimal Account Balancing
468Validate IP Address
473Matchsticks to Square
474Ones and Zeroes
475Heaters
476Number Complement
485Max Consecutive Ones
486Predict the Winner
493Reverse Pairs
494Target Sum
496Next Greater Element I
503Next Greater Element II
508Most Frequent Subtree Sum
516Longest Palindromic Subsequence
518Coin Change II
523Continuous Subarray Sum
525Contiguous Array
528Swapping Nodes in a Linked List
532K-diff Pairs in an Array
540Single Element in a Sorted Array
541Reverse String II
54201 Matrix
543Diameter of Binary Tree
545Boundary of Binary Tree
547Number of Provinces
556Next Greater Element III
557Reverse Words in a String III
560Subarray Sum Equals K
565Array Nesting
566Reshape the Matrix
567Permutation in String
570Managers with at Least 5 Direct Reports
572Subtree of Another Tree
583Delete Operation for Two Strings
584Find Customer Referee
586Customer Placing the Largest Number of Orders
595Big Countries
605Can Place Flowers
609Find Duplicate File in System
610Triangle Judgement
611Valid Triangle Number
617Merge Two Binary Trees
619Biggest Single Number
620Not Boring Movies
621Task Scheduler
627Swap Salary
629K Inverse Pairs Array
632Smallest Range Covering Elements from K Lists
633Sum of Square Numbers
642Design Search Autocomplete System
643Maximum Average Subarray I
646Maximum Length of Pair Chain
647Palindromic Substrings
649Dota2 Senate
653Two Sum IV - Input is a BST
658Find K Closest Elements
659Split Array into Consecutive Subsequences
662Maximum Width of Binary Tree
678Valid Parenthesis String
680Valid Palindrome II
682Baseball Game
684Redundant Connection
690Employee Importance
692Top K Frequent Words
694Number of Distinct Islands
695Max Area of Island
697Degree of an Array
698Partition to K Equal Sum Subsets
714Best Time to Buy and Sell Stock with Transaction Fee
716Max Stack
718Maximum Length of Repeated Subarray
721Accounts Merge
722Remove Comments
724Find Pivot Index
726Number of Atoms
729My Calendar I
730Count Different Palindromic Subsequences
733Flood Fill
735Asteroid Collision
739Daily Temperatures
740Delete and Earn
747Min Cost Climbing Stairs
761Employee Free Time
765Serialize and Deserialize N-ary Tree
768Partition Labels
774Maximum Depth of N-ary Tree
778Reorganize String
782Jewels and Stones
783Search in a Binary Search Tree
785Basic Calculator III
789Kth Largest Element in a Stream
792Binary Search
794Swim in Rising Water
795K-th Symbol in Grammar
797Rabbits in Forest
800Letter Case Permutation
801Is Graph Bipartite?
803Cheapest Flights Within K Stops
807Custom Sort String
812Rotate String
814Smallest Rotation with Highest Score
816Design HashSet
817Design HashMap
826Soup Servings
832Binary Tree Pruning
843Binary Trees With Factors
860Design Circular Queue
861Flipping an Image
866Rectangle Overlap
874Backspace String Compare
877Shortest Path Visiting All Nodes
879Maximize Distance to Closest Person
882Peak Index in a Mountain Array
883Car Fleet
886Score of Parentheses
893All Nodes Distance K in Binary Tree
898Transpose Matrix
900Reordered Power of 2
902Minimum Number of Refueling Stops
907Koko Eating Bananas
908Middle of the Linked List
912Random Pick with Weight
917Boats to Save People
921Spiral Matrix III
923Super Egg Drop
926Find and Replace Pattern
930All Possible Full Binary Trees
931Maximum Frequency Stack
940Fruit Into Baskets
941Sort Array By Parity
943Sum of Subarray Minimums
945Snakes and Ladders
948Sort an Array
952Word Subsets
957Minimum Add to Make Parentheses Valid
972Knight Dialer
975Range Sum of BST
983Validate Stack Sequences
985Bag of Tokens
998Check Completeness of a Binary Tree
1013Fibonacci Number
1014K Closest Points to Origin
1018Largest Perimeter Triangle
1019Squares of a Sorted Array
1021Distribute Coins in Binary Tree
1023Time Based Key-Value Store
1025Minimum Cost For Tickets
1029Vertical Order Traversal of a Binary Tree
1032Satisfiability of Equality Equations
1034Subarrays with K Different Integers
1036Rotting Oranges
1038Number of Squareful Arrays
1039Find the Town Judge
1044Find Common Characters
1054Complement of Base 10 Integer
1055Pairs of Songs With Total Durations Divisible by 60
1056Capacity To Ship Packages Within D Days
1058Lexicographically Smallest Equivalent String
1072Next Greater Node In Linked List
1081Video Stitching
1087Longest Arithmetic Subsequence
1105Uncrossed Lines
1106Escape a Large Maze
1111Minimum Score Triangulation of Polygon
1116Maximum Level Sum of a Binary Tree
1122Longest Duplicate Substring
1127Last Stone Weight
1128Remove All Adjacent Duplicates In String
1129Longest String Chain
1138Grumpy Bookstore Owner
1146Greatest Common Divisor of Strings
1165Meeting Scheduler
1171Shortest Path in Binary Matrix
1184Car Pooling
1185Find in Mountain Array
1187Print FooBar Alternately
1205Defanging an IP Address
1212Sequential Digits
1217Relative Sort Array
1221Element Appearing More Than 25% In Sorted Array
1224Minimum Falling Path Sum II
1227Number of Equivalent Domino Pairs
1236N-th Tribonacci Number
1249Snapshot Array
1250Longest Common Subsequence
1254Deepest Leaves Sum
1263Number of Dice Rolls With Target Sum
1279Prime Arrangements
1283Reformat Date
1285Balance a Binary Search Tree
1294Range Frequency Queries
1319Unique Number of Occurrences
1320Remove All Adjacent Duplicates in String II
1331Path with Maximum Gold
1340The Dining Philosophers
1348Maximum Score Of Spliced Array
1349Check If It Is a Straight Line
1352Maximum Profit in Job Scheduling
1356Minimum Number of Moves to Make Palindrome
1397Search Suggestions System
1400Find Winner on a Tic Tac Toe Game
1406Subtract the Product and Sum of Digits of an Integer
1407Group the People Given the Group Size They Belong To
1408Find the Smallest Divisor Given a Threshold
1414Shortest Path in a Grid with Obstacles Elimination
1418Fair Distribution of Cookies
1444Number of Steps to Reduce a Number to Zero
1446Angle Between Hands of a Clock
1461Count All Valid Pickup and Delivery Options
1463The K Weakest Rows in a Matrix
1476Count Negative Numbers in a Sorted Matrix
1477Product of the Last K Numbers
1478Maximum Number of Events That Can Be Attended
1482How Many Numbers Are Smaller Than the Current Number
1489Pizza With 3n Slices
1492Time Needed to Inform All Employees
1503Reducing Dishes
1510Find Lucky Integer in an Array
1528Kids With the Greatest Number of Candies
1542Consecutive Characters
1559Cherry Pickup II
1567Maximum Number of Vowels in a Substring of Given Length
1580Shuffle the Array
1582Design Browser History
1586Longest Subarray of 1’s After Deleting One Element
1603Running Sum of 1d Array
1630Count Odd Numbers in an Interval Range
1635Number of Good Pairs
1651Shuffle String
1653Number of Good Leaf Nodes Pairs
1669Minimum Cost to Cut a Stick
1677Matrix Diagonal Sum
1706Min Cost to Connect All Points
1713Dot Product of Two Sparse Vectors
1724Customer Who Visited but Did Not Make Any Transactions
1738Maximal Network Rank
1741Sort Array by Increasing Frequency
1748Best Team With No Conflicts
1761Count Sorted Vowel Strings
1762Furthest Building You Can Reach
1766Minimum Number of Removals to Make Mountain Array
1776Minimum Operations to Reduce X to Zero
1781Check If Two String Arrays are Equivalent
1790Lowest Common Ancestor of a Binary Tree III
1791Richest Customer Wealth
1797Goal Parser Interpretation
1798Max Number of K-Sum Pairs
1801Average Time of Process per Machine
1807Partitioning Into Minimum Number Of Deci-Binary Numbers
1814Jump Game VI
1829Maximum Units on a Truck
1833Find the Highest Altitude
1894Merge Strings Alternately
1896Maximum Score from Performing Multiplication Operations
1899Count Items Matching a Rule
1900Closest Dessert Cost
1908Recyclable and Low Fat Products
1918Maximum Score of a Good Subarray
1929Maximum Value at a Given Index in a Bounded Array
1948Rearrange Products Table
1966Frequency of the Most Frequent Element
1983Maximum Population Year
2020Remove One Element to Make the Array Strictly Increasing
2024Calculate Special Bonus
2028The Earliest and Latest Rounds Where Players Compete
2042Maximum Product Difference Between Two Pairs
2048Build Array from Permutation
2058Concatenation of Array
2095Minimum Number of Swaps to Make the String Balanced
2101Last Day Where You Can Still Cross
2118Maximum Earnings From Taxi
2119Minimum Number of Operations to Make Array Continuous
2133Number of Pairs of Strings With Concatenation Equal to Target
2137Final Value of Variable After Performing Operations
2152The Number of Seniors and Juniors to Join the Company
2162Partition Array Into Two Arrays to Minimize Sum Difference
2168Check if Numbers Are Ascending in a Sentence
2199Two Furthest Houses With Different Colors
2205Find Good Days to Rob the Bank
2210Find Target Indices After Sorting Array
2215Finding 3-Digit Even Numbers
2219Maximum Number of Words Found in Sentences
2221Check if a Parentheses String Can Be Valid
2227Sum of Subarray Ranges
2237Longest Palindrome by Concatenating Two Letter Words
2265Partition Array According to Given Pivot
2294Minimum Time to Complete Trips
2337Remove Digit From Number to Maximize Result
2368Sum of Total Strength of Wizards
2383Add Two Integers
2384Root Equals Sum of Children
2428Equal Row and Column Pairs
2472Build a Matrix With Conditions
2482Maximum Rows Covered by Columns
2491Smallest Even Multiple
2502Sort the People
2571Find the Pivot Integer
2720Minimize the Maximum Difference of Pairs
2732Counter
2747Apply Transform Over Each Element in Array
2808Painting the Walls
2809Create Hello World Function
2857Total Distance Traveled
2858Join Two Arrays by ID
3017Number of Beautiful Integers in the Range
3062Create a DataFrame from List