preloader
  • Home
  • Previous Questions

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

1st Jan, 0001

Bloomberg

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
60Permutation Sequence
61Rotate List
62Unique Paths
63Unique Paths II
64Minimum Path Sum
66Plus One
67Add Binary
68Text Justification
69Sqrt(x)
70Climbing Stairs
72Edit Distance
73Set Matrix Zeroes
74Search a 2D Matrix
75Sort Colors
77Combinations
78Subsets
79Word Search
81Search in Rotated Sorted Array II
82Remove Duplicates from Sorted List II
83Remove Duplicates from Sorted List
84Largest Rectangle in Histogram
86Partition List
88Merge Sorted Array
89Gray Code
90Subsets II
91Decode Ways
92Reverse Linked List II
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
110Balanced Binary Tree
111Minimum Depth of Binary Tree
112Path Sum
113Path Sum II
115Distinct Subsequences
116Populating Next Right Pointers in Each Node
117Populating Next Right Pointers in Each Node II
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
133Clone Graph
134Gas Station
135Candy
136Single Number
138Copy List with Random Pointer
139Word Break
140Word Break II
141Linked List Cycle
142Linked List Cycle II
143Reorder List
145Binary Tree Postorder Traversal
146LRU Cache
148Sort List
149Max Points on a Line
150Evaluate Reverse Polish Notation
151Reverse Words in a String
152Maximum Product Subarray
153Find Minimum in Rotated Sorted Array
155Min Stack
158Read N Characters Given read4 II - Call Multiple Times
159Longest Substring with At Most Two Distinct Characters
160Intersection of Two Linked Lists
162Find Peak Element
164Maximum Gap
167Two Sum II - Input Array Is Sorted
168Excel Sheet Column Title
169Majority Element
172Factorial Trailing Zeroes
173Binary Search Tree Iterator
174Dungeon Game
175Combine Two Tables
177Nth Highest Salary
179Largest Number
181Employees Earning More Than Their Managers
183Customers Who Never Order
188Best Time to Buy and Sell Stock IV
189Rotate Array
191Number of 1 Bits
197Rising Temperature
198House Robber
199Binary Tree Right Side View
200Number of Islands
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
213House Robber II
215Kth Largest Element in an Array
217Contains Duplicate
218The Skyline Problem
219Contains Duplicate II
222Count Complete Tree Nodes
224Basic Calculator
225Implement Stack using Queues
226Invert Binary Tree
227Basic Calculator II
228Summary Ranges
229Majority Element II
230Kth Smallest Element in a BST
231Power of Two
232Implement Queue using Stacks
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
241Different Ways to Add Parentheses
242Valid Anagram
252Meeting Rooms
253Meeting Rooms II
257Binary Tree Paths
258Add Digits
260Single Number III
261Graph Valid Tree
262Trips and Users
263Ugly Number
264Ugly Number II
266Palindrome Permutation
268Missing Number
269Alien Dictionary
274H-Index
278First Bad Version
279Perfect Squares
283Move Zeroes
287Find the Duplicate Number
289Game of Life
295Find Median from Data Stream
297Serialize and Deserialize Binary Tree
300Longest Increasing Subsequence
301Remove Invalid Parentheses
308Range Sum Query 2D - Mutable
309Best Time to Buy and Sell Stock with Cooldown
311Sparse Matrix Multiplication
312Burst Balloons
314Binary Tree Vertical Order Traversal
315Count of Smaller Numbers After Self
322Coin Change
326Power of Three
328Odd Even Linked List
332Reconstruct Itinerary
333Largest BST Subtree
334Increasing Triplet Subsequence
338Counting Bits
341Flatten Nested List Iterator
343Integer Break
345Reverse Vowels of a String
347Top K Frequent Elements
349Intersection of Two Arrays
350Intersection of Two Arrays II
353Design Snake Game
354Russian Doll Envelopes
359Logger Rate Limiter
362Design Hit Counter
366Find Leaves of Binary Tree
368Largest Divisible Subset
371Sum of Two Integers
373Find K Pairs with Smallest Sums
374Guess Number Higher or Lower
378Kth Smallest Element in a Sorted Matrix
380Insert Delete GetRandom O(1)
381Insert Delete GetRandom O(1) - Duplicates allowed
384Shuffle an Array
386Lexicographical Numbers
387First Unique Character in a String
389Find the Difference
390Elimination Game
392Is Subsequence
394Decode String
397Integer Replacement
399Evaluate Division
400Nth Digit
402Remove K Digits
404Sum of Left Leaves
405Convert a Number to Hexadecimal
410Split Array Largest Sum
412Fizz Buzz
413Arithmetic Slices
415Add Strings
416Partition Equal Subset Sum
417Pacific Atlantic Water Flow
420Strong Password Checker
421Maximum XOR of Two Numbers in an Array
424Longest Repeating Character Replacement
433Minimum Genetic Mutation
435Non-overlapping Intervals
437Path Sum III
441Arranging Coins
443String Compression
445Add Two Numbers II
447Number of Boomerangs
450Delete Node in a BST
451Sort Characters By Frequency
4544Sum II
458Poor Pigs
460LFU Cache
463Island Perimeter
490The Maze
492Construct the Rectangle
493Reverse Pairs
494Target Sum
496Next Greater Element I
501Find Mode in Binary Search Tree
503Next Greater Element II
506Relative Ranks
511All Paths from Source Lead to Destination
515Find Largest Value in Each Tree Row
516Longest Palindromic Subsequence
518Coin Change II
523Continuous Subarray Sum
524Longest Word in Dictionary through Deleting
528Swapping Nodes in a Linked List
529Minesweeper
532K-diff Pairs in an Array
535Encode and Decode TinyURL
539Minimum Time Difference
540Single Element in a Sorted Array
54201 Matrix
543Diameter of Binary Tree
545Boundary of Binary Tree
547Number of Provinces
550Shortest Path to Get Food
556Next Greater Element III
557Reverse Words in a String III
560Subarray Sum Equals K
566Reshape the Matrix
567Permutation in String
570Managers with at Least 5 Direct Reports
582Kill Process
583Delete Operation for Two Strings
588Design In-Memory File System
595Big Countries
605Can Place Flowers
611Valid Triangle Number
626Exchange Seats
628Maximum Product of Three Numbers
632Smallest Range Covering Elements from K Lists
633Sum of Square Numbers
636Exclusive Time of Functions
642Design Search Autocomplete System
647Palindromic Substrings
652Find Duplicate Subtrees
653Two Sum IV - Input is a BST
658Find K Closest Elements
659Split Array into Consecutive Subsequences
661Image Smoother
662Maximum Width of Binary Tree
665Non-decreasing Array
669Trim a Binary Search Tree
676Implement Magic Dictionary
678Valid Parenthesis String
680Valid Palindrome II
684Redundant Connection
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
715Range Module
716Max Stack
718Maximum Length of Repeated Subarray
721Accounts Merge
723Candy Crush
724Find Pivot Index
729My Calendar I
733Flood Fill
739Daily Temperatures
740Delete and Earn
744Network Delay Time
745Find Smallest Letter Greater Than Target
747Min Cost Climbing Stairs
750Contain Virus
764N-ary Tree Level Order Traversal
765Serialize and Deserialize N-ary Tree
766Flatten a Multilevel Doubly Linked List
777Toeplitz Matrix
778Reorganize String
779Max Chunks To Make Sorted II
780Max Chunks To Make Sorted
792Binary Search
795K-th Symbol in Grammar
796Reaching Points
803Cheapest Flights Within K Stops
807Custom Sort String
812Rotate String
813All Paths From Source to Target
820Find Eventual Safe States
826Soup Servings
843Binary Trees With Factors
854Making A Large Island
855Count Unique Characters of All Substrings of a Given String
860Design Circular Queue
864Image Overlap
873Guess the Word
874Backspace String Compare
875Longest Mountain in Array
877Shortest Path Visiting All Nodes
878Shifting Letters
879Maximize Distance to Closest Person
882Peak Index in a Mountain Array
883Car Fleet
886Score of Parentheses
888Mirror Reflection
889Buddy Strings
890Lemonade Change
893All Nodes Distance K in Binary Tree
898Transpose Matrix
907Koko Eating Bananas
908Middle of the Linked List
917Boats to Save People
922Possible Bipartition
924Fair Candy Swap
930All Possible Full Binary Trees
931Maximum Frequency Stack
937Online Stock Span
944Smallest Range I
948Sort an Array
954Maximum Sum Circular Subarray
961Long Pressed Name
967Minimum Falling Path Sum
969Number of Recent Calls
971Shortest Bridge
972Knight Dialer
985Bag of Tokens
1007Numbers With Same Consecutive Differences
1013Fibonacci Number
1019Squares of a Sorted Array
1023Time Based Key-Value Store
1025Minimum Cost For Tickets
1028Interval List Intersections
1029Vertical Order Traversal of a Binary Tree
1033Broken Calculator
1035Cousins in Binary Tree
1036Rotting Oranges
1039Find the Town Judge
1046Max Consecutive Ones III
1050Construct Binary Search Tree from Preorder Traversal
1055Pairs of Songs With Total Durations Divisible by 60
1056Capacity To Ship Packages Within D Days
1073Number of Enclaves
1095Two City Scheduling
1105Uncrossed Lines
1119Robot Bounded In Circle
1127Last Stone Weight
1128Remove All Adjacent Duplicates In String
1129Longest String Chain
1130Last Stone Weight II
1165Meeting Scheduler
1170Shortest Common Supersequence
1171Shortest Path in Binary Matrix
1176Design A Leaderboard
1179Game Play Analysis I
1184Car Pooling
1185Find in Mountain Array
1194Path In Zigzag Labelled Binary Tree
1196Filling Bookcase Shelves
1212Sequential Digits
1228Minimum Cost Tree From Leaf Values
1229Shortest Path with Alternating Colors
1233Number of Ships in a Rectangle
1240Stone Game II
1245User Activity for the Past 30 Days I
1250Longest Common Subsequence
1253Sort the Matrix Diagonally
1255Reverse Subarray To Maximize Array Value
1256Rank Transform of an Array
1258Article Views I
1263Number of Dice Rolls With Target Sum
1271Web Crawler
1272Invalid Transactions
1300Critical Connections in a Network
1306Minimum Absolute Difference
1319Unique Number of Occurrences
1320Remove All Adjacent Duplicates in String II
1371Minimum Remove to Make Valid Parentheses
1382Calculate Amount Paid in Taxes
1388Greatest Sum Divisible by Three
1414Shortest Path in a Grid with Obstacles Elimination
1427All Elements in Two Binary Search Trees
1451Minimum Number of Taps to Open to Water a Garden
1454Remove Palindromic Subsequences
1460Number of Substrings Containing All Three Characters
1464Reduce Array Size to The Half
1465Maximum Product of Splitted Binary Tree
1469Minimum Number of Steps to Make Two Strings Anagram
1476Count Negative Numbers in a Sorted Matrix
1479Construct Target Array With Multiple Sums
1488Sort Integers by The Power Value
1492Time Needed to Inform All Employees
1503Reducing Dishes
1512Design Underground System
1537Maximum Score After Splitting a String
1538Maximum Points You Can Obtain from Cards
1569Max Dot Product of Two Subsequences
1571Allocate Mailboxes
1576Reorder Routes to Make All Paths Lead to the City Zero
1580Shuffle the Array
1582Design Browser History
1603Running Sum of 1d Array
1605Minimum Number of Days to Make m Bouquets
1617Stone Game IV
1621Number of Subsequences That Satisfy the Given Sum Condition
1646Kth Missing Positive Number
1650Find Root of N-Ary Tree
1669Minimum Cost to Cut a Stick
1676Minimum Number of Days to Eat N Oranges
1700Minimum Time to Make Rope Colorful
1704Special Positions in a Binary Matrix
1705Count Unhappy Friends
1708Design Parking System
1713Dot Product of Two Sparse Vectors
1731Even Odd Tree
1737Maximum Nesting Depth of the Parentheses
1741Sort Array by Increasing Frequency
1762Furthest Building You Can Reach
1770Minimum Deletions to Make Character Frequencies Unique
1775Design an Ordered Stream
1782Smallest String With A Given Numeric Value
1798Max Number of K-Sum Pairs
1801Average Time of Process per Machine
1814Jump Game VI
1829Maximum Units on a Truck
1838Number of Distinct Substrings in a String
1903Design Most Recently Used Queue
1906Maximize Score After N Operations
1908Recyclable and Low Fat Products
1915Check if One String Swap Can Make Strings Equal
1929Maximum Value at a Given Index in a Bounded Array
1944Truncate Sentence
1948Rearrange Products Table
1951Find the Winner of the Circular Game
1960Check if the Sentence Is Pangram
1969Maximum Number of Accepted Invitations
1970Sorting the Sentence
1983Maximum Population Year
1992Sort Linked List Already Sorted Using Absolute Values
2005Check if All the Integers in a Range Are Covered
2015Determine Whether Matrix Can Be Obtained By Rotation
2042Maximum Product Difference Between Two Pairs
2090Number of Ways to Arrive at Destination
2091Number of Ways to Separate Numbers
2137Final Value of Variable After Performing Operations
2161Stock Price Fluctuation
2213Find All People With Secret
2246Maximum Employees to Be Invited to a Meeting
2271Rearrange Array Elements by Sign
2283Sort Even and Odd Indices Independently
2285Design Bitset
2286Minimum Time to Remove All Cars Containing Illegal Goods
2331Intersection of Multiple Arrays
2334Number of Flowers in Full Bloom
2357Count Integers in Intervals
2360Substring With Largest Variance
2383Add Two Integers
2532Remove Letter To Equalize Frequency
2554Minimum Total Distance Traveled
2598Shortest Distance to Target String in a Circular Array
2614Maximum Count of Positive Integer and Negative Integer
2646Kth Largest Sum in a Binary Tree
2714Left and Right Sum Differences
2733Sleep
2739Minimize the Total Price of the Trips
2754Maximum Strength of a Group
2755Extra Characters in a String