Participate in Codex, Test Your Skills & Win BIG

Coding Interview Questions


# Problem Code Type Topic Companies Average Time Score
1 Inorder Traversal code Tree Data Structure 32:00 350
2 Recover Binary Search Tree code Tree Data Structure 62:35 750
3 Inorder Traversal of Cartesian Tree code Tree Data Structure 49:57 300
4 Least Common Ancestor code Tree Data Structure 57:33 450
5 Construct Binary Tree From Inorder And Preorder code Tree Data Structure 45:12 375
6 Flatten Binary Tree to Linked List code Tree Data Structure 43:16 500
7 Preorder Traversal code Tree Data Structure 15:26 350
8 Max Depth of Binary Tree code Tree Data Structure 6:57 350
9 Binary Tree From Inorder And Postorder code Tree Data Structure 49:52 375
10 Balanced Binary Tree code Tree Data Structure 30:19 275
11 Sorted Array To Balanced BST code Tree Data Structure 28:30 300
12 Sum Root to Leaf Numbers code Tree Data Structure
45:05 350
13 Symmetric Binary Tree code Tree Data Structure 21:58 300
14 Postorder Traversal code Tree Data Structure 31:28 350
15 Populate Next Right Pointers Tree code Tree Data Structure 50:13 900
16 Identical Binary Trees code Tree Data Structure 11:36 300
17 BST Iterator code Tree Data Structure 40:34 500
18 ZigZag Level Order Traversal BT code Tree Data Structure 42:08 350
19 Path Sum code Tree Data Structure 27:34 350
20 Min Depth of Binary Tree code Tree Data Structure 17:20 350
21 Root to Leaf Paths With Sum code Tree Data Structure 41:03 350
22 Order of People Heights code Tree Data Structure
72:51 700
23 Shortest Unique Prefix code Tree Data Structure
68:01 350
24 Invert the Binary Tree code Tree Data Structure
12:46 300
25 Kth Smallest Element In Tree code Tree Data Structure 29:17 300
26 2-Sum Binary Tree code Tree Data Structure 62:58 400
27 Vertical Order traversal of Binary Tree code Tree Data Structure 71:50 200
28 Hotel Reviews code Tree Data Structure 72:07 200
29 Right view of Binary tree code Tree Data Structure 27:17 200
30 Valid BST from Preorder code Tree Data Structure 49:35 100
31 Diagonal Traversal code Tree Data Structure 41:23 200
32 Cousins in Binary Tree code Tree Data Structure 49:51 200
33 Path to Given Node code Tree Data Structure 35:18 200
34 Remove Half Nodes code Tree Data Structure 40:39 200
35 Diffk code Two Pointers
29:28 300
36 Intersection Of Sorted Arrays code Two Pointers
18:20 225
37 Merge Two Sorted Lists II code Two Pointers 25:38 200
38 3 Sum code Two Pointers 60:04 225
39 Remove Duplicates from Sorted Array code Two Pointers 31:38 250
40 Sort by Color code Two Pointers
23:12 325
41 Array 3 Pointers code Two Pointers
53:11 400
42 Container With Most Water code Two Pointers 48:15 400
43 3 Sum Zero code Two Pointers
53:35 225
44 Remove Duplicates from Sorted Array II code Two Pointers 33:23 250
45 Remove Element from Array code Two Pointers 28:29 250
46 Max Continuous Series of 1s code Two Pointers 77:14 300
47 Counting Triangles code Two Pointers
62:47 225
48 Minimize the absolute difference code Two Pointers
60:04 200
49 Actors and their Movies sql SQL Programming
34:07 100
50 Movie Character sql SQL Programming
32:30 100
51 Neutral Reviewers sql SQL Programming
23:50 100
52 Short Films sql SQL Programming
28:36 100
53 Merge K Sorted Lists code Heaps And Maps 43:21 600
54 LRU Cache code Heaps And Maps 73:11 1000
55 Distinct Numbers in Window code Heaps And Maps 39:02 600
56 Magician and Chocolates code Heaps And Maps
41:43 250
57 Ways to form Max Heap code Heaps And Maps 70:08 200
58 N max pair combinations code Heaps And Maps 76:21 200
59 Find Rectangle in binary matrix code Heaps And Maps
34:19 200
60 Convert Integer To Roman Number shell Regex and Functions
30:17 400
61 Sort by Frequency shell Regex and Functions
32:28 250
62 Swap Forward And Backward Slash shell Regex and Functions
14:29 200
63 Valid Email Address shell Regex and Functions
30:54 350
64 Gas Station code Greedy Algorithm 56:03 700
65 Majority Element code Greedy Algorithm 19:05 400
66 Distribute Candy code Greedy Algorithm 64:00 300
67 Seats code Greedy Algorithm 71:40 300
68 Highest Product code Greedy Algorithm 29:15 200
69 Assign Mice to Holes code Greedy Algorithm 21:04 300
70 Bulbs code Greedy Algorithm
22:53 200
71 Meeting rooms code Greedy Algorithm 48:27 200
72 Implement StrStr code Strings 33:14 225
73 Integer To Roman code Strings 41:29 250
74 Palindrome String code Strings
30:40 150
75 Longest Common Prefix code Strings
27:45 225
76 Roman To Integer code Strings 33:02 250
77 Length of Last Word code Strings 17:54 225
78 Multiply Strings code Strings
63:04 375
79 Valid Number code Strings 58:08 250
80 Zigzag String code Strings
52:22 300
81 Atoi code Strings 52:17 250
82 Valid Ip Addresses code Strings 64:55 250
83 Compare Version Numbers code Strings 65:49 225
84 Longest Palindromic Substring code Strings 59:43 500
85 Pretty Json code Strings
62:33 400
86 Count And Say code Strings 43:00 250
87 Justified Text code Strings
75:32 300
88 Add Binary Strings code Strings
40:32 300
89 Reverse the String code Strings 36:31 250
90 Power of 2 code Strings 62:05 350
91 Minimum Characters required to make a String Palindromic code Strings 64:30 200
92 Amazing Subarrays code Strings
26:33 150
93 Stringoholics code Strings
63:49 300
94 Substring Concatenation code Hashing
70:12 1000
95 Window String code Hashing 78:19 350
96 4 Sum code Hashing 69:24 325
97 Anagrams code Hashing 46:36 350
98 Fraction code Hashing 79:30 450
99 Points on the Straight Line code Hashing 74:54 450
100 2 Sum code Hashing 49:18 300
101 Valid Sudoku code Hashing 49:12 325
102 Copy List code Hashing 54:24 450
103 Diffk II code Hashing
28:53 375
104 Longest Substring Without Repeat code Hashing 50:49 350
105 Colorful Number code Hashing 44:51 150
106 Equal code Hashing
69:52 350
107 Largest Continuous Sequence Zero Sum code Hashing
67:12 200
108 Design Messenger subjective System Design Interview Questions 41:40 600
109 Design Search Typeahead subjective System Design Interview Questions
53:20 400
110 Design Twitter subjective System Design Interview Questions 38:20 600
111 Design URL Shortener subjective System Design Interview Questions 45:00 300
112 All Unique Permutations code Backtracking
50:49 200
113 Kth Permutation Sequence code Backtracking 72:25 350
114 Combination Sum code Backtracking 61:41 300
115 Permutations code Backtracking 39:33 350
116 Generate all Parentheses II code Backtracking
51:57 350
117 Combination Sum II code Backtracking 41:01 300
118 NQueens code Backtracking 73:26 550
119 Combinations code Backtracking 45:53 300
120 Sudoku code Backtracking 67:11 700
121 Gray Code code Backtracking
57:19 350
122 Subsets II code Backtracking 40:12 300
123 Letter Phone code Backtracking 53:18 250
124 Subset code Backtracking 61:56 250
125 Palindrome Partitioning code Backtracking 67:02 300
126 100 People in a Circle objective Puzzles
12:33 40
127 Ants on a Triangle objective Puzzles
5:00 40
128 Arrange Cubes objective Puzzles
17:07 40
129 Bee Travel objective Puzzles
8:45 40
130 Blindfolded Coin Toss objective Puzzles
3:31 40
131 Breaking Chocolate Bars objective Puzzles
5:18 40
132 Cats and a Square objective Puzzles
8:22 40
133 Celebrity Problem objective Puzzles
9:18 40
134 Color of the Bear objective Puzzles
3:37 40
135 Color of the last ball objective Puzzles
5:27 40
136 Color of the last ball II objective Puzzles
3:23 40
137 Cross the Bridge objective Puzzles
9:13 40
138 Cross the Bridge II objective Puzzles
5:47 40
139 Daughters' Ages objective Puzzles
12:35 40
140 Dinner Hand Shakes objective Puzzles
7:23 40
141 Divide Gold Bar objective Puzzles 6:09 40
142 Divide the Cake objective Puzzles
3:04 40
143 Eggs and Building objective Puzzles 13:59 40
144 Equilateral Triangles using Toothpicks objective Puzzles
6:11 40
145 Fake Note objective Puzzles
5:42 40
146 Fastest Horses objective Puzzles
7:24 40
147 Find the Defective Ball objective Puzzles
6:46 40
148 Find the Defective Ball II objective Puzzles
3:09 40
149 Gates of Heaven objective Puzzles
8:23 40
150 Genie and Hats objective Puzzles
7:50 40
151 Good Processor objective Puzzles
8:12 40
152 Helium Balloon objective Puzzles
1:55 40
153 Jelly Beans Jars objective Puzzles
7:51 40
154 Last Palindromic Date objective Puzzles
11:36 40
155 Light Switches in the Cellar objective Puzzles 3:01 40
156 Make a Statement objective Puzzles 4:25 40
157 Marbles in Jar objective Puzzles
11:43 40
158 Measure Milk by Cans objective Puzzles 16:00 40
159 Measure Time by Burning Ropes objective Puzzles
7:00 40
160 Measure Time by Hourglass objective Puzzles
9:23 40
161 Medicine Chest on a Boat objective Puzzles
9:23 40
162 Min Elevator Trips objective Puzzles
21:25 40
163 Monkeys and Doors objective Puzzles 11:30 40
164 Next Number objective Puzzles
18:15 40
165 Next Number II objective Puzzles 3:13 40
166 One Mile on the Globe objective Puzzles
7:55 40
167 Prisoners and Poison objective Puzzles 18:09 40
168 Quarters on a Table objective Puzzles
5:09 40
169 Ratio of Boys and Girls objective Puzzles
15:32 40
170 Six Colored Cubes objective Puzzles
13:55 40
171 Spider's Web objective Puzzles 3:43 40
172 Spinning Disc's Direction objective Puzzles
7:29 40
173 Ten Black and White Socks objective Puzzles
4:21 40
174 The Tribe objective Puzzles 6:20 40
175 Train Station objective Puzzles
19:08 40
176 Two Numbers objective Puzzles
12:38 40
177 Two Pills each day objective Puzzles
3:27 40
178 Wizards and Drawves objective Puzzles
13:01 40
179 World Trips objective Puzzles
9:41 40
180 Reverse Bits code Bit Manipulation 23:50 225
181 Number of 1 Bits code Bit Manipulation 8:47 200
182 Single Number code Bit Manipulation 11:53 275
183 Divide Integers code Bit Manipulation 65:42 250
184 Single Number II code Bit Manipulation 39:22 275
185 Different Bits Sum Pairwise code Bit Manipulation
50:24 300
186 Min XOR value code Bit Manipulation 37:42 200
187 Count Total Set Bits code Bit Manipulation 50:02 200
188 Palindromic Binary Representation code Bit Manipulation 52:44 200
189 Longest Increasing Subsequence code Dynamic Programming 30:39 300
190 Max Rectangle in Binary Matrix code Dynamic Programming
75:27 350
191 Distinct Subsequences code Dynamic Programming
63:01 325
192 Unique Paths in a Grid code Dynamic Programming
33:07 300
193 Max Product Subarray code Dynamic Programming 63:12 300
194 Ways to Decode code Dynamic Programming 69:28 225
195 Best Time to Buy and Sell Stocks II code Dynamic Programming 39:49 225
196 Best Time to Buy and Sell Stocks III code Dynamic Programming 60:25 700
197 Scramble String code Dynamic Programming
60:00 500
198 Best Time to Buy and Sell Stocks I code Dynamic Programming 27:50 300
199 Max Sum Path in Binary Tree code Dynamic Programming 53:37 400
200 Regular Expression Match code Dynamic Programming
70:10 500
201 Dungeon Princess code Dynamic Programming
65:03 300
202 Palindrome Partitioning II code Dynamic Programming 58:49 400
203 Min Sum Path in Matrix code Dynamic Programming 30:11 300
204 Min Jumps Array code Dynamic Programming 69:58 300
205 Edit Distance code Dynamic Programming 46:48 300
206 Unique Binary Search Trees II code Dynamic Programming 34:37 400
207 Word Break code Dynamic Programming
IBM
63:45 400
208 Regular Expression II code Dynamic Programming
61:49 500
209 Min Sum Path in Triangle code Dynamic Programming
41:52 300
210 Jump Game Array code Dynamic Programming 41:00 225
211 Interleaving Strings code Dynamic Programming
59:36 500
212 Word Break II code Dynamic Programming
IBM
63:29 350
213 Longest valid Parentheses code Dynamic Programming
58:21 700
214 Stairs code Dynamic Programming 15:14 225
215 Max Sum Without Adjacent Elements code Dynamic Programming 57:01 225
216 Repeating Sub-Sequence code Dynamic Programming
62:55 300
217 Evaluate Expression To True code Dynamic Programming 64:21 350
218 Coins in a Line code Dynamic Programming
61:03 300
219 Arrange II code Dynamic Programming 66:34 350
220 Equal Average Partition code Dynamic Programming 76:40 350
221 Coin Sum Infinite code Dynamic Programming
62:29 225
222 Rod Cutting code Dynamic Programming
70:22 350
223 Intersecting Chords in a Circle code Dynamic Programming
66:51 300
224 Count Permutations of BST code Dynamic Programming
66:25 400
225 Queen Attack code Dynamic Programming
64:41 350
226 Longest Arithmetic Progression code Dynamic Programming
70:59 200
227 Sub Matrices with sum Zero code Dynamic Programming
67:30 200
228 N digit numbers with digit sum S code Dynamic Programming
70:00 200
229 Length of Longest Subsequence code Dynamic Programming
64:46 200
230 Shortest common superstring code Dynamic Programming
64:47 200
231 Flip Array code Dynamic Programming
70:28 200
232 Smallest sequence with given Primes code Dynamic Programming 63:21 200
233 Ways to color a 3xN Board code Dynamic Programming 58:01 200
234 Tushar's Birthday Bombs code Dynamic Programming
73:19 200
235 Tushar's Birthday Party code Dynamic Programming 64:34 200
236 Kth Manhattan Distance Neighbourhood code Dynamic Programming 58:33 200
237 Largest area of rectangle with permutations code Dynamic Programming 71:43 200
238 Kingdom War code Dynamic Programming
52:55 200
239 Longest Common Subsequence code Dynamic Programming 38:05 200
240 Longest Palindromic Subsequence code Dynamic Programming
36:54 200
241 Best Time to Buy and Sell Stock atmost B times code Dynamic Programming 58:25 200
242 NESTED_CMPL2 objective Time Complexity
1:25 30
243 CHOOSE3 objective Time Complexity
1:39 50
244 NESTED_CMPL3 objective Time Complexity
3:56 80
245 CHOOSE4 objective Time Complexity
0:57 50
246 AMORTIZED1 objective Time Complexity
3:03 100
247 CHOOSE2 objective Time Complexity
2:23 80
248 GCD_CMPL objective Time Complexity
4:13 150
249 LOOP_CMPL2 objective Time Complexity
2:43 80
250 WHILE_CMPL objective Time Complexity
1:31 50
251 CHOOSE1 objective Time Complexity
1:43 50
252 LOOP_CMPL objective Time Complexity
2:43 20
253 NESTED_CMPL objective Time Complexity
1:10 20
254 REC_CMPL1 objective Time Complexity
6:58 80
255 REC_CMPL2 objective Time Complexity
6:25 80
256 REC_CMPL3 objective Time Complexity
4:39 150
257 Convert Sorted List to Binary Search Tree code Graph Data Structure & Algorithms
43:16 300
258 Level Order code Graph Data Structure & Algorithms 29:42 300
259 Capture Regions on Board code Graph Data Structure & Algorithms
63:26 500
260 Word Ladder II code Graph Data Structure & Algorithms 61:43 800
261 Clone Graph code Graph Data Structure & Algorithms 54:33 500
262 Word Search Board code Graph Data Structure & Algorithms 55:56 500
263 Word Ladder I code Graph Data Structure & Algorithms 64:29 600
264 Sum Of Fibonacci Numbers code Graph Data Structure & Algorithms
50:50 300
265 Stepping Numbers code Graph Data Structure & Algorithms 56:03 300
266 Black Shapes code Graph Data Structure & Algorithms 48:11 300
267 Knight On Chess Board code Graph Data Structure & Algorithms 64:39 300
268 Smallest Multiple With 0 and 1 code Graph Data Structure & Algorithms 68:40 300
269 Largest Distance between nodes of a Tree code Graph Data Structure & Algorithms
73:08 200
270 Commutable Islands code Graph Data Structure & Algorithms 71:58 200
271 Possibility of finishing all courses given pre-requisites code Graph Data Structure & Algorithms 61:45 200
272 Valid Path code Graph Data Structure & Algorithms 79:38 200
273 Swap List Nodes in pairs code Linked Lists 33:34 350
274 Rotate List code Linked Lists 33:55 350
275 Reorder List code Linked Lists 57:07 600
276 Sort List code Linked Lists
57:44 350
277 Remove Duplicates from Sorted List II code Linked Lists 57:51 300
278 Merge Two Sorted Lists code Linked Lists 29:11 300
279 Remove Duplicates from Sorted List code Linked Lists 17:58 300
280 Add Two Numbers as Lists code Linked Lists 43:07 250
281 Remove Nth Node from List End code Linked Lists 27:38 350
282 Partition List code Linked Lists
49:29 275
283 Insertion Sort List code Linked Lists
48:19 300
284 List Cycle code Linked Lists 39:15 600
285 Reverse Link List II code Linked Lists 57:24 450
286 Palindrome List code Linked Lists 47:06 200
287 K reverse linked list code Linked Lists 60:03 200
288 Palindrome Integer code Math
HCL
17:28 200
289 Excel Column Number code Math 23:19 175
290 Reverse integer code Math 28:36 200
291 Excel Column Title code Math 41:11 175
292 Grid Unique Paths code Math 32:35 375
293 Trailing Zeros in Factorial code Math 18:58 250
294 Rearrange Array code Math
49:03 250
295 Greatest Common Divisor code Math 10:57 200
296 Power Of Two Integers code Math 39:36 250
297 Prime Sum code Math 43:15 150
298 Sorted Permutation Rank code Math 76:44 250
299 Sorted Permutation Rank with Repeats code Math 63:15 500
300 Largest Coprime Divisor code Math
48:47 250
301 Sum of pairwise Hamming Distance code Math
66:14 200
302 Numbers of length N and value less than K code Math
88:48 200
303 FizzBuzz code Math
12:34 200
304 City Tour code Math
54:15 300
305 OSI Model-1 objective Basics of Computer Networking
10:00 30
306 OSI Model-3 objective Basics of Computer Networking
10:00 30
307 Design Cache subjective Storage Scalability 40:00 200
308 Highly Available Database subjective Storage Scalability 50:00 400
309 Highly Consistent Database subjective Storage Scalability
50:00 400
310 Sharding a Database subjective Storage Scalability 35:00 200
311 Evaluate Expression code Stacks And Queues
32:46 400
312 Rain Water Trapped code Stacks And Queues 59:00 400
313 Largest Rectangle in Histogram code Stacks And Queues 65:37 450
314 Sliding Window Maximum code Stacks And Queues 69:18 450
315 Simplify Directory Path code Stacks And Queues
53:45 250
316 Min Stack code Stacks And Queues 43:31 400
317 Redundant Braces code Stacks And Queues 42:41 300
318 Nearest Smaller Element code Stacks And Queues 41:37 350
319 MAXSPPROD code Stacks And Queues
87:31 200
320 First non-repeating character in a stream of characters code Stacks And Queues 51:23 200
321 Kth Row of Pascal's Triangle code Arrays
28:32 225
322 Rotate Matrix code Arrays 60:26 300
323 Max Sum Contiguous Subarray code Arrays 33:39 225
324 Find Duplicate in Array code Arrays 40:13 450
325 Merge Intervals code Arrays
78:57 225
326 Repeat and Missing Number Array code Arrays 63:55 350
327 Merge Overlapping Intervals code Arrays 48:24 225
328 Set Matrix Zeros code Arrays 48:04 300
329 Spiral Order Matrix II code Arrays 48:40 225
330 Largest Number code Arrays 70:26 225
331 First Missing Integer code Arrays 64:38 300
332 Add One To Number code Arrays
43:43 225
333 N/3 Repeat Number code Arrays
68:15 600
334 Pascal Triangle code Arrays 26:46 225
335 Maximum Consecutive Gap code Arrays 58:19 450
336 Max Distance code Arrays 68:14 250
337 Next Permutation code Arrays 63:13 300
338 Wave Array code Arrays 22:08 225
339 Anti Diagonals code Arrays 41:46 225
340 Hotel Bookings Possible code Arrays 66:06 225
341 Min Steps in Infinite Grid code Arrays 37:51 150
342 Flip code Arrays 78:22 400
343 Find Permutation code Arrays 55:36 300
344 Maximum Absolute Difference code Arrays 65:51 250
345 Maximum Unsorted Subarray code Arrays 68:37 250
346 Noble Integer code Arrays
43:30 200
347 Triplets with Sum between given range code Arrays
73:36 200
348 Partitions code Arrays 64:52 300
349 Multiple left rotations of the array code Arrays 22:16 200
350 Matrix Search code Binary Search
36:51 250
351 Median of Array code Binary Search 84:22 325
352 Search for a Range code Binary Search
42:02 250
353 Square Root of Integer code Binary Search 40:32 275
354 Implement Power Function code Binary Search
59:44 275
355 Rotated Sorted Array Search code Binary Search 56:53 325
356 Sorted Insert Position code Binary Search
25:03 250
357 Allocate Books code Binary Search
66:34 350
358 Painter's Partition Problem code Binary Search 80:58 350
359 Matrix Median code Binary Search 76:43 225
360 Simple Queries code Binary Search
64:21 300
361 Find a peak element code Binary Search
17:34 200
362 Lines in a given range shell Basic Shell Commands
28:42 200
363 Valid phone number shell Basic Shell Commands
21:36 150
364 Transform CSV shell Basic Shell Commands
19:53 300
365 Remove Punctuations shell Basic Shell Commands
12:36 250