I put together some recent Whatnot questions ^^.
Background: General SDE, Level 2, technical screen. I was rejected. The recruiter said my coding was good, but the system-design signal was not strong enough.
Coding — User Log / User Journey
An old question that has appeared in other interview reports. Given user activity logs containing userId, timestamp, and action, with no guarantee that the logs are ordered.
Part 1: Group by user and sort by time to get each user's action sequence. Insert the sequences into a trie, recording at each node how many users pass through that prefix, then print the whole tree in preorder with indentation and counts. Repeated occurrences of the same action count as separate steps.
Part 2, follow-up: The logs become a stream and arrive one by one. You must be able to output a summary at any time without rebuilding the trie each time. Logs for a given user arrive in timestamp order, but different users' logs are interleaved. The approach is to use a Map<userId, TrieNode> to remember each user's current trie node. For each incoming log, move one step down from that node, increment the count, and update the pointer. Ingestion is O(1). I was only asked through Part 2. Further follow-ups might cover out-of-order streams, such as watermarks and buffers, so those are worth preparing.
System Design — Donation System
Design a donation system. Functional requirements:
Users can choose the charity to donate to.
Users can complete payments without exposing credit-card details or other sensitive information.
Only users in the US are accepted, and the only currency is USD.
Besides the usual architecture, the interviewer asked some product-oriented questions:
How do you allow only USD payments? Validate it in the app frontend; there is no need to call an internal dependency.
How do you prevent spam or bot traffic? Use Device Type ID detection. An emulator's Device Type ID is not on our allowlist, so it can be blocked directly.
How should credit-card information be sent? Users must enter it themselves. Encrypt or tokenize it in the frontend before sending it to the backend. Even when integrating Stripe, users still enter their card information in the frontend; the backend does not touch plaintext card numbers.
My impression: Coding is not difficult if you have practiced the reported questions. System design was where I failed. I recommend preparing product-oriented designs such as payments and donations. The questions get quite detailed. Beyond drawing architecture diagrams, you need to clearly explain payment flows, idempotency, risk controls, and so on.
I feel the system-design interviewer just wanted a particular answer. Do not argue; go along with what he wants to hear. There is no need to think too carefully. If he runs out of patience and tells you the answer himself, that is effectively a rejection.
I hope everyone gets an offer!
Discussion
Loading comments…