Salesforce Coding Interview Questions

189 DSA problems tagged as asked in Salesforce coding interviews and online assessments. Below are the first 100 of 189: 27 easy, 24 medium and 49 hard. Start with the easy ones, then move to medium. Practise free on InternHack and track your progress.

Salesforce DSA problems, easiest first

  1. Backspace String Compare (Easy)
  2. Best Time to Buy and Sell Stock (Easy)
  3. Binary Tree Preorder Traversal (Easy)
  4. Check If a Number Is Majority Element in a Sorted Array (Easy)
  5. Check Whether Two Strings are Almost Equivalent (Easy)
  6. Count Binary Substrings (Easy)
  7. Count Vowel Substrings of a String (Easy)
  8. Find Pivot Index (Easy)
  9. Height Checker (Easy)
  10. Kth Largest Element in a Stream (Easy)
  11. Largest Number After Digit Swaps by Parity (Easy)
  12. Last Stone Weight (Easy)
  13. Matrix Similarity After Cyclic Shifts (Easy)
  14. Maximum Height of a Triangle (Easy)
  15. Maximum Product of Three Numbers (Easy)
  16. Maximum Units on a Truck (Easy)
  17. Merge Two Sorted Lists (Easy)
  18. Minimum Absolute Difference (Easy)
  19. Missing Number (Easy)
  20. Move Zeroes (Easy)
  21. Odd String Difference (Easy)
  22. Roman to Integer (Easy)
  23. Shortest Distance to Target String in a Circular Array (Easy)
  24. Split a String in Balanced Strings (Easy)
  25. Two Sum (Easy)
  26. Valid Palindrome (Easy)
  27. Valid Parentheses (Easy)
  28. Average Waiting Time (Medium)
  29. Beautiful Towers I (Medium)
  30. Beautiful Towers II (Medium)
  31. Count the Number of Fair Pairs (Medium)
  32. Diameter of N-Ary Tree (Medium)
  33. Finding the Number of Visible Mountains (Medium)
  34. Least Number of Unique Integers after K Removals (Medium)
  35. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit (Medium)
  36. Longest Substring Of All Vowels in Order (Medium)
  37. Magnetic Force Between Two Balls (Medium)
  38. Maximize Greatness of an Array (Medium)
  39. Maximum Earnings From Taxi (Medium)
  40. Maximum Number of Occurrences of a Substring (Medium)
  41. Minimum Equal Sum of Two Arrays After Replacing Zeros (Medium)
  42. Minimum Operations to Reduce an Integer to 0 (Medium)
  43. Number of Divisible Triplet Sums (Medium)
  44. Number of Operations to Make Network Connected (Medium)
  45. Paths in Maze That Lead to Same Room (Medium)
  46. Remove Adjacent Almost-Equal Characters (Medium)
  47. Search Suggestions System (Medium)
  48. Sum of Nodes with Even-Valued Grandparent (Medium)
  49. The kth Factor of n (Medium)
  50. Time Needed to Rearrange a Binary String (Medium)
  51. Using a Robot to Print the Lexicographically Smallest String (Medium)
  52. Basic Calculator (Hard)
  53. Binary Tree Maximum Path Sum (Hard)
  54. Bus Routes (Hard)
  55. Candy (Hard)
  56. Cherry Pickup II (Hard)
  57. Collect Coins in a Tree (Hard)
  58. Concatenated Words (Hard)
  59. Count Palindromic Subsequences (Hard)
  60. Count Subarrays With Median K (Hard)
  61. Count the Number of Infection Sequences (Hard)
  62. Count the Number of Inversions (Hard)
  63. Course Schedule III (Hard)
  64. Design a Text Editor (Hard)
  65. Distinct Subsequences (Hard)
  66. Find Median from Data Stream (Hard)
  67. Find Subarray With Bitwise OR Closest to K (Hard)
  68. Find the Last Marked Nodes in Tree (Hard)
  69. Find the Minimum Area to Cover All Ones II (Hard)
  70. First Missing Positive (Hard)
  71. IPO (Hard)
  72. LFU Cache (Hard)
  73. Longest Increasing Path in a Matrix (Hard)
  74. Max Chunks To Make Sorted II (Hard)
  75. Maximal Rectangle (Hard)
  76. Maximize Grid Happiness (Hard)
  77. Maximum Frequency Stack (Hard)
  78. Maximum Number of Non-overlapping Palindrome Substrings (Hard)
  79. Maximum Number of Ways to Partition an Array (Hard)
  80. Maximum Path Quality of a Graph (Hard)
  81. Median of Two Sorted Arrays (Hard)
  82. Merge k Sorted Lists (Hard)
  83. Minimize Malware Spread (Hard)
  84. Minimum Difficulty of a Job Schedule (Hard)
  85. Minimum Number of Taps to Open to Water a Garden (Hard)
  86. Minimum Window Substring (Hard)
  87. N-Queens (Hard)
  88. Number of Digit One (Hard)
  89. Number of Visible People in a Queue (Hard)
  90. Optimal Account Balancing (Hard)
  91. Partition Array Into Two Arrays to Minimize Sum Difference (Hard)
  92. Reconstruct Itinerary (Hard)
  93. Reverse Nodes in k-Group (Hard)
  94. Sliding Window Maximum (Hard)
  95. Smallest Substring With Identical Characters I (Hard)
  96. Smallest Substring With Identical Characters II (Hard)
  97. Split Array Largest Sum (Hard)
  98. Subarrays with K Different Integers (Hard)
  99. Trapping Rain Water (Hard)
  100. Word Ladder (Hard)

Prepare for the rest of the Salesforce process

Other companies