# Longest Consecutive Sequence & Cliff Tree Stability

### Interview Summary

**Problem type**: Longest Consecutive Sequence  
**Interview question**:  
Given an unsorted array of integers, return the length of the longest consecutive element sequence (e.g., 1, 2, 3, 4). The elements do not need to appear in order within the array - they simply need to exist. The optimal solution requires O(n) time, pushing beyond the intuitive sort-based O(n log n) approach by leveraging a hash set to identify sequence start points and expand outward.

### Interview Feedback

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

#### Areas of Strength
- Strong ability to handle complex, multi-part questions without getting intimidated  
- Good at clarifying the problem before diving in — asked the right questions to understand direction  
- Communicated well throughout — able to talk through the problem line by line  
- Showed awareness of efficient data structures — was moving in the right direction with hash sets and hash maps  
- Noticeably stronger on the second question — shows the ability to ramp up mid-interview

#### Room for Improvement
- Got bogged down on the first question — made assumptions instead of asking clarifying questions upfront, particularly around duplicates  
- If a question is unclear, keep asking until it fully makes sense — diving in without understanding the problem will hurt more than the time spent clarifying  
- For a senior role, always lead with the most efficient solution rather than defaulting to brute force. Before writing anything, ask yourself if there is a more optimal approach available. Only walk through brute force if it is a necessary stepping stone to get to the efficient solution.  
- Problem decomposition needs work — break the question into smaller pieces before jumping to code. A consecutive sequence has a start and an end — working backwards from that insight leads naturally to the right data structure.

#### Things to Do Differently in the Next Interview
- Always ask clarifying questions upfront — especially about edge cases like duplicates  
- If you do not understand the question, keep asking until you do. It is completely acceptable and expected  
- Before diving into code, check in with the interviewer — say something like "I think I am ready to go, am I heading in the right direction?"  
- Treat it as a collaborative technical conversation, not a one-way test  
- Be clock aware — in the first 20 minutes, push to finish the problem as fast as possible while keeping correctness and efficiency in mind. Having that time awareness in the back of your head will help with pacing across the full interview.

#### Open Notes
- One month of prep is a solid start. The main recommendation going forward is a structured daily practice routine:  
  - Do three to four LeetCode questions per day from NeetCode 75 or NeetCode 150, focusing on the problem types you are weakest in  
  - Spend no more than five to eight minutes attempting a question before looking at the solution if stuck — the goal is pattern recognition, not grinding through every problem cold  
  - Come back to any unsolved question three days later and attempt it again  
  - At the end of every week, redo all the questions from that week — if you did three questions a day for six days, that is 18 questions to review on Sunday  
  - For a senior role, system design is also on the table — do one system design question per day alongside two to three LeetCode questions  
  - Do not get burnt out. Consistency over intensity.

The instincts are there. The gap right now is execution speed, confidence in the solution before running it, and leading with optimal approaches from the start. That closes with deliberate practice.
