Python Interview with a FAANG engineer.

Grid Path Finding, Merge Intervals & Tennis Scorekeeper

Watch someone solve the the problem: grid path finding, merge intervals & tennis scorekeeper problem in an interview with a FAANG engineer and see the feedback their interviewer left them. Explore this problem and others in our library of interview replays.

Grid Path Finding, Merge Intervals & Tennis Scorekeeper: Python Interview with a FAANG Engineer. - YouTube

Grid Path Finding, Merge Intervals & Tennis Scorekeeper: Python Interview with a FAANG Engineer.

Interview Summary

Problem type
The Problem: Grid Path Finding, Merge Intervals & Tennis Scorekeeper

Interview question
Three problems are covered in sequence. First, the interviewee implements BFS to find a path through a 2D grid from a start cell to a target cell, then extends the solution to handle obstacles and return the shortest distance to the nearest of multiple targets. Second, the interviewee merges overlapping intervals from an unsorted input array. Third, the interviewee designs a tennis scorekeeper class that tracks scores for two players, enforces winning conditions, and prevents score updates after the game ends.

Interview Feedback

Feedback about Logarithmic Owl (the interviewee)
Advance this person to the next round? Yes
How were their technical skills? 3/4
How was their problem solving ability? 4/4
What about their communication ability? 4/4

Strengths & what went well
You understood the prompt quickly and moved into a workable approach without needing much clarification. You explained your thinking as you went and were responsive to hints or follow-up questions. When issues came up, you were able to reason through them and correct course.
Areas for improvement
There were some opportunities to be more precise with complexity analysis, especially around how different data structures affect runtime. Some implementation choices could also be simplified by leaning more directly on the constraints of the problem.
Advice for future interviews
Before coding, briefly name the algorithm and why it fits the problem. After coding, test with a small case and state time and space complexity. When considering a more advanced data structure, explain what extra capability it gives and whether the current problem needs it.

Feedback about Metal Turtle (the interviewer)
Would you want to work with this person? Yes
How excited would you be to work with them? 4/4
How good were the questions? 4/4
How helpful was your interviewer in guiding you to the solution(s)? 4/4

Interview Transcript

Logarithmic Owl: Hello? Hello, can you hear me? Yeah, I can hear you.

Metal Turtle: Okay, sorry, I was plugging in my headphones. Yeah, so we can maybe do a short series of intros and then we can spend most of the time on the problem...

Logarithmic Owl: ...and so, um, I guess like we're just moving through, traversing through the zeros.

Metal Turtle: Correct.

Logarithmic Owl: Yeah, okay, that's what I figured. Okay, cool. So we'll just go through, move through the zeros. There is maybe some weird cases where, like, if it's surrounded by S's again, I don't think that's something that we're going to be worrying about. And we'll just only traverse through zeros.

...

Interview solution metrics

Comments on Further Improvements in Code

  1. Use of BFS Over Dijkstra: While BFS is optimal for unweighted graphs, using Dijkstra's would be beneficial if weights were introduced.
  2. Optimizing Merge Intervals: Instead of popping elements continuously, maintain a reference to the last added interval for merging.
  3. Tennis Scorekeeper Design: Use a winner index array to simplify conditional checks and make it easier to manage scores.

Conclusion

Overall performance feedback was positive. Each problem was addressed well, and communication remained clear throughout the interview. Further study into runtime complexities and potential optimizations could strengthen future performances.