Hacker News new | ask | show | jobs
by dmw1 1632 days ago
Got this question at a FAANG company. Interviewer was absolutely not satisfied with linear solution and wanted it solved in log(m + n)

There's a huge meta-game around these questions that you pick up after practicing them enough.

Even without the hint, I intuitively know looking at that question that linear time is too easy for a 1 hour face to face interview at Google.

I also know that as the data is sorted the optimal solution must be logarithmic, as in these contrived problems there's no such thing as an unnecessary detail. Monotonic means binary search.

I haven't built this intuition from my experience as a software developer, but by spending my free time playing the game and grinding these arbitrary puzzles.

The fact you missed this meta, tells me absolutely nothing about your skills as a developer, only that you haven't been grinding leetcode.

That shouldn't be a signal not to hire you, but that's how the game works at FAANG.

If you can make this observation about the arrays, and code a fully functional binary search taking into account whether the total length of both arrays is odd/even, handling the out of bounds case, whilst under pressure on your third interview of the day with just the intuition you've built in your day job, then as far as i'm concerned you are the exception not the rule.