Longest Consecutive Sequence & Tree Cliff Grid: Interview with a FAANG Engineer
Longest Consecutive Sequence & Tree Cliff Grid
Watch someone solve the longest consecutive sequence & tree cliff grid 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.
Longest Consecutive Sequence / Tree Cliff Grid: C++ Interview with a FAANG Engineer - YouTube
Interview Summary
Problem type
Longest Consecutive Sequence & Tree Cliff Grid
Interview question
The first problem asks the candidate to find the length of the longest consecutive integer sequence in an unsorted array, solved optimally in O(n) time using a hash set. The second is a custom grid problem: given a 2D cliff modeled as a binary grid where trees are stable only if connected to the bottom row, determine the resulting grid after cutting a specified tree and letting all newly unstable trees fall.
Interview Feedback
Feedback about Hurricane Automaton (the interviewee)
Advance this person to the next round?
Yes
How were their technical skills?
4/4
How was their problem solving ability?
3/4
What about their communication ability?
3/4
1. Strengths
- Clarifying questions — You asked good questions upfront instead of making assumptions and diving in blind. This is a green flag for interviewers
- Technical ability — You are solid as an engineer. You solved Q1 independently and Q2 with only minor nudges
- Collaborative style — You consistently checked in with the interviewer before moving forward, which shows good communication instincts
2. Room for Improvement
Pacing
- You overcommunicated on Q1. By the time you were explaining, you already had the right answer
- The rule of thumb: one good example to confirm understanding, then start coding
- You could have finished Q1 roughly 8 minutes earlier
- You don't need to walk through every single line of code with the interviewer. One clean trace through one test case is enough to demonstrate understanding, then move on
Time Allocation
- Real interviews are structured as easy Q1 + harder Q2
- Your goal is to bank time on Q1 so you have a full runway for Q2
- You were still explaining Q1 when you should have already been halfway through Q2
Syntax Under Pressure
- The infinite loop bug was a simple
i++vsj++mistake — classic one-off error- When you're in a time crunch and hit an infinite loop, don't panic and rush
- Slow down, check your counters, check your loop increments — it's almost always something small like that
- This one was purely a byproduct of rushing, not a knowledge gap
Subarray vs. Consecutive Sequence
- There was a moment of confusion around whether the problem was asking for a subarray or a consecutive sequence
- Know this distinction cold going into any interview:
- Subarray = elements must be literally adjacent, you cannot sort
- Consecutive sequence = elements just need to form a sequence numerically, order in the array doesn't matter, sorting or hash set both work
- You knew the right approach (hash set), the confusion was just in the framing of the problem
3. Open Notes
- The confusion about subarray vs. sequence came up early — you actually explained the correct answer to the interviewer before you realized you already had it. Trust yourself more in those moments
- When you hit something that feels too straightforward, don't second-guess it. Ask one confirming question ("so I can just sort this?") and move on rather than sitting in uncertainty
- The dynamic programming instinct was kicking in for the consecutive sequence problem, which is actually the harder version of the problem. Recognizing that this was the easier variant (hash set, not DP) was the unlock
4. What To Do Differently Next Interview
- Get approval, then go — Once the interviewer confirms your approach, stop re-explaining and start typing
- One trace, not a full walkthrough — Walk through one example line by line to show you understand it, then run the test case and move forward
- Protect your Q2 time — Treat Q1 like a sprint. Clean, correct, efficient, done
- When you hit a bug — Pause, breathe, check your counters and loop variables first. Don't let a one-line fix spiral into a 5-minute panic
- Trust your instincts — You clearly have the technical ability. The limiting factor right now is pacing and confidence, not knowledge
Feedback about Stealthy Elephant (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