HackTheRounds Interview Experiences

Pinterest Software Engineer Interview Experience (2024) - Feed Ranking Design, Offer

Pinterest SWE loop: coding rounds on graph and heap problems, system design for home feed ranking, and a behavioral round heavy on collaboration stories. Roughl

By Anonymous ยท 2024-10-03

Background

I interviewed with Pinterest in the fall of 2024 for a mid-level backend role on one of the discovery and recommendations teams. I had two years of backend experience at a larger company doing distributed-systems work in Java and Go, and had been quietly studying recsys fundamentals on the side because I wanted to move closer to ranking and feed problems. A recruiter reached out after a referral landed in their queue, and from first contact to signed offer was about four weeks, which surprised me because I had heard Pinterest could drag.

Timeline

Total: about 4 weeks.

Online Assessment (90 min, HackerRank)

Three problems, mostly medium. The first was a streaming top-K engagement problem framed in Pinterest language, where events of the form (board id, engagement score) arrive in order and the system must return the top K boards by total engagement over a rolling five-minute window. I used a hash map for per-board totals, a deque to expire events outside the window, and a heap to track the top K. The heap was a minor trap because you have to handle stale entries lazily, which I did by comparing the cached sum at pop time with the current map value.

The second was a deduplication problem where a list of pin titles had to be clustered by case-insensitive punctuation-stripped anagram equivalence. I normalized each title to a sorted character key and bucketed. Nothing tricky once you see the shape.

The third was a sessionization problem, splitting a user's timestamped actions into sessions whenever the gap exceeds thirty minutes. A single linear pass with a running session-start pointer. I finished with about ten minutes to spare and used it to annotate my code and double check the midnight boundary case.

Virtual Onsite (4 rounds)

Round 1: Coding, Merge Overlapping Campaign Windows

Problem: Given a list of campaign time windows, each with a start, end, and a priority, merge overlapping windows such that the merged window inherits the highest priority among its constituents.

The base case is the standard sort-by-start-and-sweep merge. The priority twist means that as you extend the current merged window, you take the max priority seen so far. The interviewer's follow-up was what happens when windows carry multiple attributes beyond priority, say a campaign id and a budget, and the merge semantics differ per attribute. I refactored the merge into a reducer that takes a function per attribute, which the interviewer liked. The final complexity was O(N log N) dominated by the sort.

is in the same family of "sweep with structured state" problems and is a good warmup for this kind of round.

Round 2: System Design, Home Feed Ranking

Problem: Design the Pinterest home feed for a user. Given a pool of candidate pins and signals about a user's boards, repins, searches, and follows, produce a personalized, ranked feed that refreshes periodically and scales to hundreds of millions of users.

This was the round where I spent the most prep time and it paid off. I framed the feed as a classic three-stage recommender. First, candidate generation, which pulls a few thousand pins from multiple sources in parallel. Related pins based on recent user engagement, board-based similarity through a co-occurrence graph of boards, and a popularity source for cold-start coverage. Second, a light ranker, a cheap model scoring each candidate on a handful of features (pin age, engagement prior, category affinity) to narrow the pool to maybe five hundred. Third, a heavy ranker, a deep model that uses user embeddings, pin embeddings, and context features to produce the final top N.

The interviewer pushed on the freshness and staleness tradeoff. I argued for a split where the heavy ranker output is cached per user for a short window (a few minutes) but candidate generation is rerun more aggressively on engagement events through a Flink job that updates the user embedding in near real time. We talked about the feature store next. I went with an offline batch store built on top of a warehouse for training features and an online key-value store for serving features at inference, with a shared feature definition so training and serving do not drift.

The follow-up that stretched me was about how to launch a new ranking model without degrading engagement. I described a holdback slice of traffic, an online counterfactual estimator using the existing ranker's propensity scores, and a rollout gated on both offline replay metrics and short-term online A/B results. The interviewer was smiling by the end, which I took as a good sign.

is a graph shape that shows up in candidate-generation discussions and was useful warmup for thinking about traversal cost.

Round 3: Behavioral, Collaboration and Values

Three prompts that all circled the same theme. Tell me about a time you simplified a system that had grown too complex. Tell me about a time you pushed back on a product decision because you believed it was wrong for the user. Tell me about a mistake you made on a launch and how you recovered.

I used STAR and I stayed concrete. The simplification story was about a duplicate feed suppression service I had rewritten from a quadratic similarity check into a MinHash plus LSH pipeline that shipped with a 12x latency drop. The pushback story was about a ranking change that would have optimized short-term clicks at the cost of long-term session quality, where I ran a three-week replay analysis to convince the PM to adjust. The mistake was a cache-warmup bug that caused a cold-start regression on launch day, caught through a dashboard that I had instrumented ahead of time but missed the alert on. The interviewer asked me what I would do differently, and I said I would have paged myself on the canary metric instead of only on errors.

Round 4: Coding and Culture Fit, Search Autocomplete

Problem: Given a stream of queries typed by a user, return the top three historical queries that share the current prefix, ranked by frequency and then lexicographically.

I went with a trie where each node stored a small sorted list (length three) of the most frequent queries in its subtree. On each insert, I walked the path and updated the list at every node if the new query qualified. On lookup, I walked to the prefix node and returned its list directly, which made lookups O(prefix length). The interviewer pushed on memory, and I described a variant that stored query ids rather than strings and a second variant that moved infrequent branches off-heap. The last ten minutes were culture fit questions, mostly why Pinterest, what I thought of the product, and whether I used it myself. I answered honestly: I use it mostly for recipes and home-improvement research and I had thoughts about the quality of non-English results.

[[problem/475?company=28|Search Autocomplete with Trie]] is the exact problem and I would not walk into a Pinterest loop without being able to write it from memory.

Result

Verbal offer came eleven days after the final onsite. Base was in line with expectations, equity refresh was generous, and the sign-on covered the unvested equity I was walking away from at my prior company. I negotiated a small base bump using a competing offer and accepted.

Tips

  1. Pinterest's system design rounds are recsys-flavored. URL shorteners and chat servers are not the shape you want to practice. Run through a full feed or ranking design, including candidate generation, light and heavy rankers, feature stores, and experimentation, before the loop.
  2. The OA rewards speed more than cleverness. Three problems in ninety minutes means two of them have to go on autopilot. Drill the streaming top-K and sessionization patterns until you can type them in fifteen minutes each.
  3. Know the difference between the light ranker and the heavy ranker. Candidates who describe a ranking stage as a single model get pushed on latency. Candidates who describe a two-stage funnel get to talk about the interesting tradeoffs.
  4. Bring a concrete engagement metric story to the behavioral round. Pinterest measures itself in session quality and long-term engagement. Stories that show you understand the difference between short-term and long-term wins land well.
  5. Use the product before the loop. The culture fit conversation assumes you have opinions about Pinterest. If you do not, ten minutes of honest exploration will get you most of the way there.
  6. Plan for a tight schedule. My loop was four weeks end to end. Clear your calendar in the week after OA because the onsite windows can compress fast.