Whatnot·Software Engineer·Technical Phone Screen
- Given a list of user action logs as (user_id, timestamp, action) tuples, implement a function that builds a trie-like prefix tree of user journeys and returns it as a formatted multiline string. Each node should show the action and how many distinct users passed through that prefix. Children should be printed in insertion order, users processed in ascending ID order, and ties in timestamp should preserve original input order.
“Took me a bit to realize the ordering rules were doing a lot of work here.”