Home/DSA Problems/Most asked

The problems every company asks

165 problems that appear at 4 or more major companies. If you do not yet know where you are interviewing, start here — these are the ones that pay off wherever you end up.

Ordered foundational first within each difficulty, not by how hard they feel.

medium91 problems
  1. 1.Maximum Subarray
  2. 2.Product of Array Except Self
  3. 3.3Sum
  4. 4.Container With Most Water
  5. 5.Merge Intervals
  6. 6.Spiral Matrix
  7. 7.Search in Rotated Sorted Array
  8. 8.Longest Substring Without Repeating Characters
  9. 9.Longest Palindromic Substring
  10. 10.LRU Cache
  11. 11.Binary Tree Level Order Traversal
  12. 12.Validate Binary Search Tree
  13. 13.Number of Islands
  14. 14.Course Schedule
  15. 15.Coin Change
  16. 16.Longest Increasing Subsequence
  17. 17.Word Break
  18. 18.Generate Parentheses
  19. 19.Kth Largest Element in an Array
  20. 20.Top K Frequent Elements
  21. 21.Implement Trie (Prefix Tree)
  22. 22.Find First and Last Position in Sorted Array
  23. 23.Course Schedule II
  24. 24.Cheapest Flights Within K Stops
  25. 25.Max Area of Island
  26. 26.Remove Nth Node From End of List
  27. 27.Sort List
  28. 28.Copy List with Random Pointer
  29. 29.Decode String
  30. 30.Group Anagrams
  31. 31.Count and Say
  32. 32.Zigzag Conversion
  33. 33.K Closest Points to Origin
  34. 34.Implement Trie (Prefix Tree)
  35. 35.Detect Cycle in Directed Graph
  36. 36.Detect Cycle in Directed Graph
  37. 37.Basic Calculator II
  38. 38.Largest Number
  39. 39.Topological Sort (Classic)
  40. 40.Largest Number
  41. 41.Basic Calculator II
  42. 42.Topological Sort (Classic)
  43. 43.Add Two Numbers
  44. 44.Multiply Strings
  45. 45.Multiply Strings
  46. 46.Add Two Numbers
  47. 47.Sort Colors
  48. 48.Construct Binary Tree from Preorder and Inorder Traversal
  49. 49.String to Integer (atoi)
  50. 50.Sort Colors
  51. 51.String to Integer (atoi)
  52. 52.Construct Binary Tree from Preorder and Inorder Traversal
  53. 53.Next Permutation
  54. 54.Linked List Cycle II
  55. 55.Kth Smallest Element in a Sorted Matrix
  56. 56.Valid Parenthesis String
  57. 57.Valid Parenthesis String
  58. 58.Kth Smallest Element in a Sorted Matrix
  59. 59.Next Permutation
  60. 60.Valid Parenthesis String
  61. 61.Linked List Cycle II
  62. 62.Kth Smallest Element in a Sorted Matrix
  63. 63.Longest Consecutive Sequence
  64. 64.Longest Consecutive Sequence
  65. 65.Number of Ways to Arrive at Destination
  66. 66.Longest Consecutive Sequence
  67. 67.Search in Rotated Sorted Array II
  68. 68.Number of Ways to Arrive at Destination
  69. 69.Set Matrix Zeroes
  70. 70.Lowest Common Ancestor of a Binary Tree
  71. 71.Set Matrix Zeroes
  72. 72.Lowest Common Ancestor of a Binary Tree
  73. 73.Set Matrix Zeroes
  74. 74.Lowest Common Ancestor of a Binary Tree
  75. 75.Insert Interval
  76. 76.Insert Interval
  77. 77.Insert Interval
  78. 78.Insert Interval
  79. 79.Search a 2D Matrix II
  80. 80.Non-overlapping Intervals
  81. 81.Non-overlapping Intervals
  82. 82.Non-overlapping Intervals
  83. 83.Non-overlapping Intervals
  84. 84.Gas Station
  85. 85.Gas Station
  86. 86.Gas Station
  87. 87.Gas Station
  88. 88.Simplify Path
  89. 89.Construct Binary Tree from Inorder and Postorder
  90. 90.Coin Change II
  91. 91.Shortest Unsorted Continuous Subarray

Where to go from here

Working through these covers most of what a generalist interview draws on. Once you know which company you are interviewing at, its page lists what that company specifically asks — and the full bank has every problem grouped by pattern.

Company tags come from reported interview questions and are a guide, not a guarantee.