Skip to content

Top 50 Interview questions

#ProblemSolution
1Two SumRead solution
2Add Two NumbersRead solution
3Longest Substring Without Repeating CharactersRead solution
4Median of Two Sorted ArraysRead solution
5Longest Palindromic SubstringRead solution
6Regular Expression Matching—
7Container With Most WaterRead solution
83SumRead solution
9Letter Combinations of a Phone Number—
10Remove Nth Node From End of ListRead solution
11Valid ParenthesesRead solution
12Merge Two Sorted ListsRead solution
13Generate Parentheses—
14Merge k Sorted ListsRead solution
15Longest Valid Parentheses—
16Search in Rotated Sorted ArrayRead solution
17Find First and Last Position of Element in Sorted Array—
18Combination SumRead solution
19First Missing Positive—
20Trapping Rain WaterRead solution
21Jump Game II—
22PermutationsRead solution
23Rotate ImageRead solution
24Group AnagramsRead solution
25Maximum SubarrayRead solution
26Jump Game—
27Merge IntervalsRead solution
28Unique PathsRead solution
29Minimum Path SumRead solution
30Climbing StairsRead solution
31Edit DistanceRead solution
32Sort ColorsRead solution
33Minimum Window Substring—
34SubsetsRead solution
35Word SearchRead solution
36Largest Rectangle in HistogramRead solution
37Maximal Rectangle—
38Binary Tree Inorder TraversalRead solution
39Unique Binary Search Trees—
40Validate Binary Search TreeRead solution
41Symmetric TreeRead solution
42Binary Tree Level Order TraversalRead solution
43Maximum Depth of Binary TreeRead solution
44Construct Binary Tree from Preorder and Inorder TraversalRead solution
45Flatten Binary Tree to Linked ListRead solution
46Best Time to Buy and Sell StockRead solution
47Binary Tree Maximum Path SumRead solution
48Longest Consecutive SequenceRead solution
49Single Number—
50Copy List with Random PointerRead solution