I had an onsite interview with Google yesterday (Round 2). The recruiter started with a warm-up question:
You're given an N×N grid with a start point S, an end point T, and some cells blocked by water. You can move only up, down, left, or right. Determine whether there's a valid path from S to T. No coding was required—just explain your approach.
We ended up discussing this question for quite a while. I suggested using either BFS or DFS, but the interviewer asked me to explain both algorithms in detail, along with their time and space complexity. That took about 12–14 minutes.
Then I was given the main question:
A mouse is trying to get from its starting position S to a piece of cheese at T, but there’s a cat at position C. The grid is still N×N with some water cells that can't be crossed, and movement is restricted to the four cardinal directions. The goal is to find a path from S to T where the shortest distance to the cat C along the path is as large as possible. Use Manhattan distance to measure how close the mouse gets to the cat.
We discussed the solution strategy, edge cases, and complexity analysis. I even walked through a dry-run example. But I ran out of time and was only able to write about half of the code.
Based on this experience, how is this kind of performance usually evaluated? Would it be considered a “lean hire” or a “lean no hire”?