← Whatnot Interview Insights

Whatnot·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Jul 2026Remote

Summary

Interviewed for a software engineer role at WhatNot and came out of it feeling genuinely rattled, less because of the problems themselves and more because of how the interviewer handled the feedback mid-interview. Two coding questions each with follow-ups in 40 minutes, and the back half turned into a pretty uncomfortable experience.

Questions Asked (2)

Q1

Given a string, remove all runs of consecutive duplicate characters. Follow-up: what if a run can contain any number of matching characters, not just pairs?

Algorithms & Data Structures
Author's notes

The base version was fine, stack-based, explained complexity, tested it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the exact definition of a 'run' (e.g., pairs vs. any length) and whether removal is iterative or single-pass. Then propose a stack-based solution that processes characters in one pass, and discuss how the follow-up changes the logic (e.g., using a stack of characters and counts).

Pro tip: Mention that the follow-up (runs of any length) is equivalent to the 'remove all adjacent duplicates' problem, which can be solved with a stack in O(n) time; also note that if removal is iterative (like Candy Crush), a stack of (char, count) is needed to handle cascading removals.

1. Clarify the problem

Ask whether a run is exactly two characters or any number, and whether removal is single-pass or iterative (cascading). Confirm input/output format and constraints.

2. Choose a data structure

For single-pass removal of any-length runs, use a stack of characters. For iterative removal, use a stack of (character, count) pairs to track runs and trigger removals.

3. Walk through the algorithm

Iterate through the string, pushing characters onto the stack. If the top of the stack matches the current character, increment the count (or pop for pairs). If a run reaches the removal threshold, pop it.

4. Analyze complexity

State that the time complexity is O(n) because each character is pushed and popped at most once, and space is O(n) for the stack in the worst case.

5. Test with examples

Walk through edge cases: empty string, all same characters, alternating characters, and cascading removals (e.g., 'abba' -> '' if iterative).

Key Points to Mention

  • Stack-based approach for O(n) time and space
  • Difference between single-pass and iterative (cascading) removal
  • Handling runs of any length vs. exactly pairs
  • Using a stack of (char, count) for iterative removal
  • Edge cases: empty string, no duplicates, all duplicates
  • Time and space complexity analysis

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

Q2

Merge two sorted arrays and return a sorted array of their squared values. Follow-up: handle negative numbers in the input arrays.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Nailed the positive-only version.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First clarify that the arrays are sorted and we need to return a new sorted array of squares. Then present a two-pointer approach from the end of the merged array, comparing absolute values to place the largest square at the end, achieving O(n+m) time and O(1) extra space (excluding output).

Pro tip: Explicitly call out that squaring can destroy the sorted order when negatives are present, and that comparing absolute values is the key insight. This shows you anticipate edge cases and think about invariants, which interviewers value.

1. Clarify requirements and constraints

Confirm that the input arrays are sorted, can contain negative numbers, and that the output should be a new sorted array of squared values. Ask about duplicates, empty arrays, and whether in-place modification is allowed.

2. Discuss naive approaches and trade-offs

Mention that merging then squaring then sorting is O((n+m) log(n+m)) and simple, but not optimal. Explain that squaring first and then merging is tricky because squares of negatives can be out of order.

3. Present the optimal two-pointer approach

Use two pointers starting at the end of each array, compare absolute values, and place the larger square at the end of the result array. Move the pointer of the chosen element inward and repeat.

4. Analyze complexity and edge cases

State time complexity O(n+m) and space O(n+m) for the output (or O(1) extra if output is pre-allocated). Walk through edge cases: one array empty, all negatives, all positives, zeros, and duplicates.

5. Code and test with examples

Write clean code with meaningful variable names, then test with examples like [-4,-1,0,3,10] and [-7,-3,2,3,11]. Verify the output is sorted and correct.

Key Points to Mention

  • Two-pointer technique from the end of the arrays to avoid shifting elements
  • Comparing absolute values to determine the larger square
  • Time complexity O(n+m) and space complexity O(n+m) for the result array
  • Handling negative numbers: squares of negatives can be larger than positives, so order is not preserved
  • Edge cases: empty arrays, single element, all negatives, all positives, duplicates
  • Alternative approaches and their trade-offs (e.g., merge then sort, or square then merge with extra space)

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