Google·Software Engineer·Onsite - Coding / Algorithms
May 2026
Google SWE coding round, two questions back to back. First one felt like a heap problem dressed up with extra sorting rules, second was a binary search question that I almost overcomplicated. Neither was brutal but both had enough edge cases to trip you up if you moved too fast.
- Given an array of 2D points that may contain duplicates, return the top K distinct points ranked by frequency (descending), then by squared distance to the origin (ascending) as a tiebreaker, then by x and y coordinates ascending if still tied.
- Design a time-based key-value store that supports storing values with timestamps and retrieving the value whose timestamp is closest to a given query timestamp, with ties broken in favor of the smaller timestamp.
“My first instinct was a hash map for counts, then sort.” The rest of the author's notes on Software Engineer interview at Google, Onsite - Coding / Algorithms round, covers how they worked through the question, what the panel pushed back on, and what they would do differently.
View Post