← Whatnot Interview Insights

Whatnot·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Whatnot software engineer interview with a coding problem around message filtering. The question was more implementation-focused than algorithmic but had a few gotchas that made it less trivial than it looked.

Questions Asked (1)

Q1

Given an array of message dictionaries (each mapping a username to a message string) and a list of unsafe words, return only the messages where none of the unsafe words appear as whole words. Make sure punctuation is handled correctly so that something like 'damn,' still matches the unsafe word 'damn'.

Algorithms & Data StructuresAPI & IntegrationsTechnical Trade-offs
Author's notes

The whole-word matching piece is where I almost tripped up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the input structure and define 'whole word' matching, emphasizing that punctuation should be treated as word boundaries. Then propose a solution that normalizes each message by extracting words using a regex or splitting on non-alphanumeric characters, and checks against a set of unsafe words. Discuss trade-offs between regex and manual tokenization, and mention edge cases like case sensitivity and Unicode.

Pro tip: Mention that you would preprocess the unsafe words into a set for O(1) lookups and use a regex with word boundaries (\b) to handle punctuation correctly, but be aware that \b may not work for all Unicode characters. Also, consider if the message can contain multiple words and if the unsafe words can be substrings of other words (e.g., 'damn' in 'damnation') — whole word matching avoids false positives.

1. Clarify requirements and edge cases

Ask about input format, case sensitivity, definition of 'whole word', handling of punctuation, and whether unsafe words can contain punctuation. Confirm expected output format.

2. Choose a matching strategy

Decide between regex with word boundaries or tokenizing the message into words by splitting on non-alphanumeric characters. Consider performance and Unicode support.

3. Implement the filter

For each message, extract words, convert to lowercase if case-insensitive, and check if any word is in the unsafe set. If none, include the message.

4. Test with edge cases

Validate with examples like 'damn,' 'damn!' 'damnation', and messages with multiple unsafe words. Ensure punctuation is handled and no false positives/negatives.

5. Discuss trade-offs and optimizations

Talk about time/space complexity, precompiling regex, using sets for O(1) lookups, and potential issues with Unicode word boundaries.

Key Points to Mention

  • Definition of 'whole word' and how punctuation acts as a delimiter
  • Using regex with word boundaries (\b) or tokenization via re.findall(r'\w+', message)
  • Case sensitivity: normalize to lowercase for comparison
  • Preprocessing unsafe words into a set for efficient lookup
  • Handling Unicode and locale-specific word boundaries
  • Time and space complexity: O(n*m) where n is number of messages and m is average message length

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.