Whatnot phone screen, rejected after the graph question
Whatnot phone screen, rejected after the graph question
Phone screen for Whatnot, one round, an hour total, rejected after. Recruiter screen got skipped, went straight into the coding round.
Question was building a transition graph out of raw access logs. Every log entry has a timestamp, a user id, and a resource, all unordered. Had to reconstruct each user's path through resources based on their timestamps, then treat that path as a sequence of transitions, adding virtual start and end states before the first and after the last resource. Any two users hitting the same transition just add to the same running count. Then for each source you divide by its total outgoing count to get a probability, round it, and return everything sorted by source then target.
Grouping and sorting by user first was the easy part. Getting the start and end edges counted right without double counting anything was the fiddly bit. Ended up using a hash map keyed by source resource pointing to a counter of targets, then a second pass to turn the counts into probabilities.
Follow up asked what happens if a user has two logs at the exact same timestamp, and then whether the whole thing could work on a stream instead of a fixed batch. Didn't have a clean answer for the streaming part on the spot.
Heard back a few days later, rejected. No specifics given.
Replies (0)
No replies yet — start the conversation!