Mastercard coding interview
questions, leaked.
12 problems reported across recent Mastercard interviews. Top patterns: array, string, dynamic programming. The list below is what most reported candidates actually saw, plus the honest play if you can't grind all of it.
Mastercard's coding assessment leans heavily on array and string manipulation, with 8 of 12 reported problems centered on arrays. Most questions fall in the easy to medium range, but don't let that fool you. The hard problem (Candy) requires solid greedy logic, and problems like Longest Palindromic Substring and Coin Change demand clean dynamic programming. You're looking at a 5 to 7 day sprint to own this list. If you hit a wall on the live assessment, StealthCoder runs invisibly beside you and surfaces a working solution in seconds.
Top problems at Mastercard
| # | Problem | Diff | Frequency | Pass % | Patterns |
|---|---|---|---|---|---|
| 01 | Two Sum | EASY | 100.0 | 56% | Array · Hash Table |
| 02 | Valid Parentheses | EASY | 94.1 | 42% | String · Stack |
| 03 | Best Time to Buy and Sell Stock | EASY | 86.5 | 55% | Array · Dynamic Programming |
| 04 | Valid Anagram | EASY | 86.5 | 67% | Hash Table · String · Sorting |
| 05 | Subsets | MEDIUM | 75.8 | 81% | Array · Backtracking · Bit Manipulation |
| 06 | Fizz Buzz | EASY | 75.8 | 74% | Math · String · Simulation |
| 07 | Container With Most Water | MEDIUM | 75.8 | 58% | Array · Two Pointers · Greedy |
| 08 | Rotate Image | MEDIUM | 75.8 | 78% | Array · Math · Matrix |
| 09 | Longest Palindromic Substring | MEDIUM | 75.8 | 36% | Two Pointers · String · Dynamic Programming |
| 10 | Candy | HARD | 75.8 | 47% | Array · Greedy |
| 11 | Gas Station | MEDIUM | 75.8 | 46% | Array · Greedy |
| 12 | Coin Change | MEDIUM | 75.8 | 46% | Array · Dynamic Programming · Breadth-First Search |
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 Mastercard OA. The proctor cannot see it. Screen share cannot detect it. Built because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround.
Get StealthCoder- array8 · 67%
- string4 · 33%
- dynamic programming3 · 25%
- greedy3 · 25%
- hash table2 · 17%
- math2 · 17%
- two pointers2 · 17%
- stack1 · 8%
- sorting1 · 8%
- backtracking1 · 8%
The distribution here is top-heavy on arrays because Mastercard likes problems that test your ability to iterate, partition, and optimize under constraints. Two-pointer techniques (Container With Most Water, Longest Palindromic Substring) and greedy strategies (Gas Station, Candy) appear across multiple problems, so pattern recognition matters. Dynamic programming shows up in 3 problems but mostly in medium difficulty, so you can skip advanced DP until you're confident on the array and string foundations. Start with Two Sum and Valid Anagram to warm up, then move to Container With Most Water and Rotate Image. Candy is the outlier hard problem and uses greedy logic that doesn't generalize much, so treat it as a final stress test. If you haven't drilled greedy or DP patterns before your OA, StealthCoder is your safety net when one lands.
Companies with similar patterns
If you prepped for Mastercard, these companies recycle ~60% of the same topics.
You've seen the list.
Now make sure you pass Mastercard.
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 because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Mastercard interview FAQ
How many array problems should I solve before the Mastercard assessment?+
At least 6 to 8. Arrays dominate the list with 8 of 12 problems. Start with Two Sum, Best Time to Buy and Sell Stock, and Container With Most Water. These three cover hashing, iteration, and two-pointer patterns you'll see again.
Is dynamic programming required for Mastercard's assessment?+
It appears in 3 of 12 problems (Best Time to Buy and Sell Stock, Longest Palindromic Substring, Coin Change), but none are hard except the greedy Candy problem. You can pass by nailing the array and string foundations first, then adding DP solutions once you're comfortable.
Should I learn greedy algorithms before this assessment?+
Yes. Gas Station and Candy both use greedy logic, and Container With Most Water uses a greedy two-pointer approach. That's 3 of 12 problems. Spend a day drilling the greedy pattern on these three, then you're set.
What's the hardest problem Mastercard reportedly asks?+
Candy is the only hard problem reported. It requires a greedy two-pass algorithm that most candidates miss on first attempt. If you have time, drill it last. It's an outlier and won't block you from passing if you nail the mediums.
How should I split my week between topics?+
Day 1-2: array basics (Two Sum, Best Time to Buy and Sell Stock, Rotate Image). Day 3: two-pointer and greedy (Container With Most Water, Gas Station). Day 4: strings and hash tables (Valid Anagram, Valid Parentheses). Day 5-6: dynamic programming and Candy. Day 7: mock run-through of mixed problems.