MEDIUMasked at 1 company

Report Spam Message

A medium-tier problem at 48% community acceptance, tagged with Array, Hash Table, String. Reported in interviews at Salesforce and 0 others.

Founder's read

You've got a message thread, a list of spam IDs, and two minutes to figure out which messages to filter. Report Spam Message hits candidates who overthink the data structure and waste time on edge cases that don't matter. Salesforce has asked this one. The acceptance rate sits at 48%, which means half the people who attempt it walk away with nothing. This is a screening filter problem disguised as something harder. If you blank on the right approach during the live OA, StealthCoder solves it invisibly and gets you past the wall.

Companies asking
1
Difficulty
MEDIUM
Acceptance
48%

Companies that ask "Report Spam Message"

If this hits your live OA

Report Spam Message 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 by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE.

Get StealthCoder
What this means

The trick is recognizing this as a lookup problem, not a search problem. You're given an array of messages and a set of spam IDs. The naive approach checks each message against a list of spam IDs, which tanks your time complexity if you don't convert the spam list to a hash table first. Once you do, filtering becomes O(n) instead of O(n*m). Most candidates either miss the hash table optimization entirely or second-guess themselves on whether it's worth the memory trade-off. The String and Array topics are red herrings. The real work is Hash Table. If you walk into the assessment without drilling this pattern, you'll waste minutes on a problem that's actually straightforward once you see it. StealthCoder is your hedge if the pattern isn't clicking under the clock.

Pattern tags

The honest play

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

Report Spam Message 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 by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Report Spam Message interview FAQ

Is this problem still asked at Salesforce?+

Yes, it appears in their screening assessments. The acceptance rate of 48% suggests it's actively used to filter candidates. It's not a one-off. If you're interviewing there, treat this as a must-know, not a nice-to-have.

Why do so many people fail this if it's just a hash table?+

Because they don't recognize it as a hash table problem at first glance. They try to sort, use nested loops, or overthink whether they need to preserve order. By the time they pivot to the right approach, they're out of time. It's medium difficulty not because of complexity but because the framing is deceptive.

Do I need to preserve the original message order?+

The input doesn't specify. Most likely you return an array of non-spam messages in original order. If the problem statement is vague during your OA, code for the most general case first: iterate through messages, check each ID against your hash table, keep non-spam messages in sequence.

What languages handle this best?+

Any language with fast hash sets or hash maps. Python sets, Java HashSet, JavaScript Set, C++ unordered_set all give you O(1) lookup. Avoid languages where you're forced to use sorted arrays or linked lists for the spam list. Hash table is non-negotiable here.

Is this related to other hash table problems I should know?+

Yes. This is a simplified version of filtering patterns that come up in logs, content moderation, and permission systems. Once you see the hash table lookup pattern, you'll recognize it in harder problems. String and Array are just the data types, not the core concept.

Want the actual problem statement? View "Report Spam Message" 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.