Pinterest SWE onsite, grant access round plus two SDs
Pinterest SWE onsite, grant access round plus two SDs
Finished my Pinterest SWE onsite Thursday, 5 rounds, no news yet. Writing the coding down while I still remember it.
Coding 1 was the grant access thing. Advertisers get access to groups, and groups nest like world > country > city. You implement grant, revoke and check. If an advertiser has access to a country they have it for every city under it. I built it as a tree with parent pointers. Follow up was making grant and revoke O(1) and check O(depth), so you just store the grant on the node and walk up from the bottom when checking. Took me a minute to see I didn't need to push anything down to the children.
Coding 2 was aggregating violation logs, records of pin id, policy, date. Count unique pins for a policy, then unique pins in a date range, then unique pins per policy inside a range. Not hard but pin ids repeat everywhere. I asked what to return for a policy with zero hits and the interviewer wouldn't really say, so I just picked something.
Then two system design rounds, which I somehow didn't expect going in tbh. One was a notification system, the other a rate limiter. Rate limiter guy kept having me compare token bucket vs sliding window for their traffic, felt like 20 min of just that lol.
BQ was short, mostly about giving someone negative feedback.
Overall fine I think?