Missing Ranges & One Edit Distance: Interview with a FAANG Engineer

Missing Ranges & One Edit Distance

Watch someone solve the missing ranges & one edit distance 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
Missing Ranges & One Edit Distance

Interview question
The first problem asks the candidate to return the shortest sorted list of ranges that cover all missing numbers within a given inclusive range [lower, upper], given a sorted unique integer array. The second problem asks whether two strings are exactly one edit distance apart, where a single edit is defined as an insertion, deletion, or replacement of one character in the source string.

Interview Feedback

Feedback about Rocket Centaur (the interviewee)
Advance this person to the next round?
No
How were their technical skills?
2/4
How was their problem-solving ability?
2/4
What about their communication ability?
3/4

Communication:
He was engaged throughout the interview and communicated his thought process clearly. He successfully solved the easy problem with an O(n) solution.

Areas for Improvement:
He should focus on improving his coding speed and problem-solving efficiency. He attempted the medium-complexity question but was unable to complete it within the available time. For the One Edit Distance problem, he initially proposed a dynamic programming approach, which added unnecessary complexity to the solution.

Advice for Future Interviews:
Focus on improving coding speed and quickly identifying the simplest optimal approach. Aim to complete easy questions within the first 20 minutes and medium-complexity questions within 20–30 minutes, leaving enough time to test the solution and discuss edge cases.

Feedback about Verdant Goblin (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

Rocket Centaur: Hello.
Rocket Centaur: Hello, how are you? Hey, I'm good. How are you?
Rocket Centaur: I'm doing okay. I hope you're having a good day so far.
Rocket Centaur: Yeah, so far so good. Thanks for asking. Um, so this is a data structures algorithm coding interview, right?
Rocket Centaur: That's correct.
Rocket Centaur: All right, uh, we can get started. Uh, so what is your language of choice?
Rocket Centaur: I would pick Python. I would probably choose that here. Yes, I would go with Python 3. Yes.
Rocket Centaur: Okay. All right. Um, so are there any specific companies you are targeting for so that we can, uh, change our coding?
Rocket Centaur: Yeah, nothing, nothing specifically. I'm just doing this as toβ€” but it's been a while that I've done some coding exercise. So it's been like more than a couple of years. So yeah, just, just getting prepared for that.
Rocket Centaur: Okay, let's start with the brief introduction. Normally I provide feedback on the introduction as well. So why don't you start introducing so that we can get started?
Rocket Centaur: Sure, sure. I have around like 16, 17+ years of experience. I started working in like 2010, '11. Initially was a Java developer, backend Java developer, and A couple of years back, and in 2023, that's where I moved to ML AI space. So since then, I was an ML engineer, then I got into AI agentic automation. Yeah, that's, that's a whole thing about my, my tenure. Recently, I've been, you know, doing lots of automations on agentic with LangGraph and LangChain. Um, yeah, that's, that's in precise about me.
Rocket Centaur: Okay, all right, sounds good. Uh, so in this interview I'll be asking 2 questions. Uh, one is like, you see, [REDACTED] Easy and [REDACTED] Medium. Uh, so if you solve those 2 questions, I can go, uh, go with one more question as well. Makes sense?
Rocket Centaur: Sure, sure, perfect. All right, um, after I completed Sorry, no, no, no, I said that I would, I would try to complete it. I don't know how far I can do, but yeah, yeah.
Rocket Centaur: All right, so should I paste the question here?
Rocket Centaur: Yeah, yeah, that should be fine.
Rocket Centaur: I don't know what is a comment in Python.


Interview question:
You are given an inclusive range, lower and upper, and a sorted unique integer array numbers where all elements are within the inclusive range. Return the shortest sorted list of ranges that exactly covers all the missing numbers.


Additional Insights Provided:

  1. If the nums is empty and if there is a lower and upper there, probably you should return -1 or the empty output.
  2. The solution should run in O(n).

Final Remarks:
Focus on improving coding speed and practice edge cases.