MEDIUMasked at 3 companies

Invalid Transactions

A medium-tier problem at 31% community acceptance, tagged with Array, Hash Table, String. Reported in interviews at Wix and 2 others.

Founder's read

Invalid Transactions is a medium-difficulty problem that hits your OA when you're weakest: right after the warmup, when you're not awake yet. It's asked by Wix, Bloomberg, and PayPal, companies that care about transaction validation logic in real systems. You're given a list of transactions and need to flag the ones that violate simple rules: amount over 1000 or no matching name/city pair in the same minute. The trap is that the obvious O(n^2) brute force either times out or miscounts duplicates. If you blank on the hash table trick during your live assessment, StealthCoder surfaces a working solution invisible to the proctor.

Companies asking
3
Difficulty
MEDIUM
Acceptance
31%

Companies that ask "Invalid Transactions"

If this hits your live OA

Invalid Transactions is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made for the engineer who has done the work but might still blank with a webcam pointed at him.

Get StealthCoder
What this means

The problem requires you to parse transaction strings, validate each one against the others, and return the invalid ones. Most candidates start with nested loops and get confused about what constitutes a valid pair (same name, same minute, different city). The real insight is using a hash table keyed by name and timestamp to bucket transactions, then checking each candidate against its bucket in one pass. You need to handle string parsing cleanly, respect the 60-second minute window (don't hardcode boundaries wrong), and track which transactions are invalid without double-counting. Sorting the output is extra overhead that catches people who skip it. The 31% acceptance rate reflects how easy it is to miss edge cases around duplicate names or off-by-one minute logic. StealthCoder is your hedge if the parsing or bucketing pattern doesn't click in the first five minutes.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Invalid Transactions recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made for the engineer who has done the work but might still blank with a webcam pointed at him. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Invalid Transactions interview FAQ

Is this really a medium or is it harder?+

It's a true medium, but the 31% acceptance rate means most people fail it. The trap isn't algorithmic complexity; it's string parsing, minute-boundary logic, and tracking state correctly. If you nail the hash table bucketing and test your minute comparison, you pass.

Do Wix, Bloomberg, and PayPal actually ask this?+

Yes, all three have reported it. They're all in fintech or payment-adjacent spaces, so transaction validation is native to their interview library. Expect it if you're interviewing with any of them.

What's the main trick I'm missing?+

Group transactions by name and minute using a hash table. Then for each transaction, check if any other transaction in the same (name, minute) group has a different city. You also flag anything over 1000 immediately. Hash table bucketing cuts your search space from O(n^2) to O(n).

How does this relate to the Hash Table topic?+

Hash Table is core. You'll use it to group by (name, minute) so you can validate city pairs in one pass instead of scanning the whole array repeatedly. Without it, you'll TLE or write bug-prone nested loops.

Is there a sorting trick I should know?+

The output must be sorted. Most candidates forget this or try to sort mid-processing. Collect invalid transaction indices in a set, then sort and return them at the end. It's not complex, but it's easy to miss in a timed OA.

Want the actual problem statement? View "Invalid Transactions" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.