# Python Interview with a FAANG engineer

#### Watch someone solve the overlapping intervals 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.

### Interview Summary

**Problem type**  
Overlapping Intervals  
**Interview question**  
1) Given two real closed intervals, determine whether they overlap or not.  
2) Given N real closed intervals, determine whether they overlap or not.

### Interview Feedback

**Feedback about DJ Flamingo (the interviewee)**

**Advance this person to the next round?**  
Yes

**Technical skills rating:**  
3/4

**Problem solving ability rating:**  
3/4

**Communication ability rating:**  
3/4

**What went well:**  
- Clarifications made for both the problems were really good, eg. what does real mean or what does closed mean, what it means for N intervals to overlap etc.
- There were no gaps of silence; you always thought out loud, and the interviewer was always clear in what direction you were thinking. This is a very good habit with respect to interviews.
- Overall code quality is excellent; maybe you can read more about Python Production Readability.
- Speed of coding is excellent.
- Your thinking ability and problem solving was also very good.

**What could've been better:**  
- It's good to suggest complexities of the written code oneself, without the interviewer prompting for it.
- In general, an interview is being guided more by the interviewee than the interviewer. You are leading it and you are taking constant yes from the interviewer before proceeding.
- Writing good test cases. Make sure you write test cases which include edge cases, thoroughly enough before thinking of possible approaches. This will help to build an approach which is thorough and complete and will also aid in writing code clearly. The interviewer need not give any corrections.
- Always try to dry run the code yourself without the interviewer asking for it, to make sure you haven't made any logical mistakes in the writing of the code. The interviewer should not generally point out any mistakes in the code.

### Interview Transcript

**Stochastic Storm:** So coding round in Google, I hope you know it's 45 minutes.  
**DJ Flamingo:** Okay.  
**Stochastic Storm:** You have gone through the process. In case you are aware of, it's typically 45 minutes. Coding round.  
**DJ Flamingo:** Yes.  
**Stochastic Storm:** So let's assume that some five minutes are intros, et cetera.  
**DJ Flamingo:** Okay.  
**Stochastic Storm:** Or maybe the closing questions.  
**DJ Flamingo:** Okay, yeah, sounds good.  
 **Stochastic Storm:** All right, let's get started. You have already chosen the language. And here we go. So your question is given two real closed intervals. Determine whether they overlap or not.

- **DJ Flamingo:** Okay. So close interval. And I think my question is just to clarify, what if the start and end is the same? For example, I have an interval of 13, and the other is three, five. Do we think they overlap or not?
- **Stochastic Storm:** So that's what I mean by the closed intervals part, right? It means that the boundaries are inclusive.
- **DJ Flamingo:** Okay, cool. And. Okay, I think I got it. And I think I pretty well get what you mean. And I can show you an example solution using a whiteboard. Do you prefer that or just write here?
- **Stochastic Storm:** I mean, typically we may not have that luxury of the whiteboard.
  
- **(Discussion about coding the solution continues, including clarification of edge cases and complexities...)**

### Time and Space Complexity Discussion

- **DJ Flamingo:** The final time complexity is O(N log N). Space is O(1).

### Final Feedback

**General Tips From Stochastic Storm:**  
- Important topics: Graphs (all algorithms), Trees, and Binary Search.
- Overall, the communication was very good, with no gaps of silence.
- Continue working on writing good test cases and addressing edge cases in the future.

---
