Salesforce coding interview
questions, leaked.
138 problems reported across recent Salesforce interviews. Top patterns: array, string, hash table. The list below is what most candidates actually saw, plus the honest play if you can't grind all of it.
Salesforce's interview loop hits you with 138 reported problems, skewed hard toward arrays (78 occurrences) and strings (43). The difficulty split is brutal: 87 medium, 30 hard, only 21 easy. You're not grinding fundamentals here. You're prepping for constraint problems, cache design, and substring manipulation under pressure. If you freeze on a hash-table or DP pattern mid-assessment, StealthCoder runs invisible during the OA and surfaces a working solution in seconds. That's your real safety net.
Top problems at Salesforce
| # | Problem | Diff | Frequency | Pass % | Patterns |
|---|---|---|---|---|---|
| 01 | Count Subarrays With Median K | HARD | 0.0 | 46% | Array · Hash Table · Prefix Sum |
| 02 | Minimum Operations to Reduce an Integer to 0 | MEDIUM | 0.0 | 57% | Dynamic Programming · Greedy · Bit Manipulation |
| 03 | Word Break | MEDIUM | 93.6 | 48% | Array · Hash Table · String |
| 04 | Subarray Product Less Than K | MEDIUM | 87.3 | 53% | Array · Binary Search · Sliding Window |
| 05 | String Compression | MEDIUM | 84.8 | 58% | Two Pointers · String |
| 06 | Distinct Subsequences | HARD | 80.4 | 50% | String · Dynamic Programming |
| 07 | LFU Cache | HARD | 80.4 | 47% | Hash Table · Linked List · Design |
| 08 | Merge Intervals | MEDIUM | 80.4 | 49% | Array · Sorting |
| 09 | LRU Cache | MEDIUM | 78.8 | 45% | Hash Table · Linked List · Design |
| 10 | Group Anagrams | MEDIUM | 75.1 | 71% | Array · Hash Table · String |
| 11 | Number of Islands | MEDIUM | 75.1 | 62% | Array · Depth-First Search · Breadth-First Search |
| 12 | Optimal Account Balancing | HARD | 0.0 | 50% | Array · Dynamic Programming · Backtracking |
| 13 | Report Spam Message | MEDIUM | 0.0 | 48% | Array · Hash Table · String |
| 14 | Longest Common Subsequence | MEDIUM | 0.0 | 58% | String · Dynamic Programming |
| 15 | Palindromic Substrings | MEDIUM | 73.0 | 72% | Two Pointers · String · Dynamic Programming |
| 16 | Longest Substring Without Repeating Characters | MEDIUM | 73.0 | 37% | Hash Table · String · Sliding Window |
| 17 | Design a Text Editor | HARD | 73.0 | 47% | Linked List · String · Stack |
| 18 | Maximum Frequency Stack | HARD | 73.0 | 66% | Hash Table · Stack · Design |
| 19 | Count the Number of Fair Pairs | MEDIUM | 73.0 | 53% | Array · Two Pointers · Binary Search |
| 20 | Height Checker | EASY | 73.0 | 81% | Array · Sorting · Counting Sort |
| 21 | Course Schedule II | MEDIUM | 70.8 | 53% | Depth-First Search · Breadth-First Search · Graph |
| 22 | Check If a Number Is Majority Element in a Sorted Array | EASY | 70.8 | 59% | Array · Binary Search |
| 23 | Beautiful Towers I | MEDIUM | 70.8 | 43% | Array · Stack · Monotonic Stack |
| 24 | Beautiful Towers II | MEDIUM | 70.8 | 35% | Array · Stack · Monotonic Stack |
| 25 | Check Whether Two Strings are Almost Equivalent | EASY | 70.8 | 64% | Hash Table · String · Counting |
| 26 | Best Time to Buy and Sell Stock | EASY | 68.3 | 55% | Array · Dynamic Programming |
| 27 | Split Array Largest Sum | HARD | 68.3 | 58% | Array · Binary Search · Dynamic Programming |
| 28 | Trapping Rain Water | HARD | 68.3 | 65% | Array · Two Pointers · Dynamic Programming |
| 29 | Valid Parentheses | EASY | 68.3 | 42% | String · Stack |
| 30 | Binary Tree Maximum Path Sum | HARD | 65.5 | 41% | Dynamic Programming · Tree · Depth-First Search |
| 31 | Kth Largest Element in an Array | MEDIUM | 65.5 | 68% | Array · Divide and Conquer · Sorting |
| 32 | Beautiful Arrangement | MEDIUM | 65.5 | 65% | Array · Dynamic Programming · Backtracking |
| 33 | Maximum Product of Three Numbers | EASY | 62.3 | 45% | Array · Math · Sorting |
| 34 | Asteroid Collision | MEDIUM | 62.3 | 46% | Array · Stack · Simulation |
| 35 | Largest Number | MEDIUM | 62.3 | 41% | Array · String · Greedy |
| 36 | Integer to Roman | MEDIUM | 62.3 | 69% | Hash Table · Math · String |
| 37 | Longest Palindromic Substring | MEDIUM | 58.6 | 36% | Two Pointers · String · Dynamic Programming |
| 38 | Minimum Window Substring | HARD | 58.6 | 45% | Hash Table · String · Sliding Window |
| 39 | Count Palindromic Subsequences | HARD | 58.6 | 39% | String · Dynamic Programming |
| 40 | Meeting Rooms II | MEDIUM | 58.6 | 52% | Array · Two Pointers · Greedy |
| 41 | Task Scheduler | MEDIUM | 58.6 | 62% | Array · Hash Table · Greedy |
| 42 | Coin Change | MEDIUM | 58.6 | 46% | Array · Dynamic Programming · Breadth-First Search |
| 43 | 3Sum | MEDIUM | 58.6 | 37% | Array · Two Pointers · Sorting |
| 44 | Validate Binary Search Tree | MEDIUM | 54.3 | 34% | Tree · Depth-First Search · Binary Search Tree |
| 45 | Min Stack | MEDIUM | 54.3 | 56% | Stack · Design |
| 46 | Decode Ways | MEDIUM | 54.3 | 37% | String · Dynamic Programming |
| 47 | Top K Frequent Elements | MEDIUM | 54.3 | 65% | Array · Hash Table · Divide and Conquer |
| 48 | Maximal Square | MEDIUM | 54.3 | 49% | Array · Dynamic Programming · Matrix |
| 49 | Decode String | MEDIUM | 49.0 | 61% | String · Stack · Recursion |
| 50 | Degree of an Array | EASY | 49.0 | 57% | Array · Hash Table |
Frequencies derived from public community-tagged interview reports. Click a row to view on LeetCode.
You have a week, maybe less. You can't out-grind the list above. StealthCoder runs invisibly during the actual Salesforce OA. The proctor cannot see it. Screen share cannot detect it. Built by an Amazon engineer who used it to pass JPMorgan's OA and system design loop.
Get StealthCoder- array78 · 57%
- string43 · 31%
- hash table34 · 25%
- dynamic programming33 · 24%
- sorting22 · 16%
- two pointers17 · 12%
- depth first search16 · 12%
- greedy15 · 11%
- binary search15 · 11%
- stack15 · 11%
Arrays dominate the distribution, but this isn't about basic iteration. Problems like Count Subarrays With Median K and Subarray Product Less Than K demand prefix sums, sliding windows, and careful edge-case handling. Strings are the second pillar: Group Anagrams, String Compression, and Distinct Subsequences mix hashing, two-pointers, and DP. Hash-table and dynamic-programming questions (34 and 33 respectively) often collide on problems like Word Break and LRU Cache, forcing you to recognize both the data structure and the recurrence relation at once. Design problems (LFU Cache, LRU Cache) are harder than they look. Drill arrays and strings first, then lock in DP patterns, because when you hit a wall on the live OA, you won't have time to reverse-engineer the recurrence.
Companies with similar patterns
If you prepped for Salesforce, these companies recycle ~60% of the same topics.
You've seen the list.
Now make sure you pass Salesforce.
Memorizing every problem above in a week is a fantasy. StealthCoder is the hedge: an AI overlay that's invisible during screen share. It reads the problem on screen and surfaces a working solution in under 2 seconds. Built by an Amazon engineer who used it to pass JPMorgan's OA and system design loop. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Salesforce interview FAQ
How many array problems should I solve before a Salesforce OA?+
Array problems appear in 78 of 138 reported questions, often paired with other patterns like hash-table or prefix sum. Aim to solve at least 20-25 unique array problems, prioritizing sliding window and prefix-sum variants. Subarray Product Less Than K and Count Subarrays With Median K are representative of Salesforce difficulty.
Are dynamic programming problems essential for Salesforce?+
Yes. DP appears in 33 problems and frequently intertwines with strings and arrays. Word Break, Distinct Subsequences, and Longest Common Subsequence are common. Expect at least one hard DP problem. Practice memoization and bottom-up approaches on strings and subarrays before your OA.
Should I study design (cache) problems?+
Absolutely. LRU Cache and LFU Cache are on the reported list and are medium-to-hard design questions. They test your grasp of hash-tables, linked lists, and system thinking. Spend at least a few hours on cache eviction logic and doubly-linked list manipulation.
What's the easiest way to avoid bombing a medium hash-table problem?+
Hash-table problems (34 reported) often boil down to recognizing when you need a frequency map or grouping. Group Anagrams and Report Spam Message are examples. If you can't recall the pattern during the OA, you'll blank. StealthCoder catches that in real time and shows you the working solution.
Is two-pointers worth drilling heavily?+
It appears in 17 problems, much lower than arrays or strings, but two-pointers is fast to master and shows up in String Compression, Merge Intervals, and Palindromic Substrings. Spend a few hours on it, then shift focus to DP and hash-table problems where Salesforce's harder rounds concentrate.