Find the First Unique Log
Company: Uber
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Onsite
Quick Answer: This question evaluates a candidate's ability to analyze and implement efficient data-processing and frequency-detection strategies on ordered string sequences, with attention to time and memory complexity.
Constraints
- logs length can be large
- log entries are strings
Examples
Input: (['login', 'click', 'logout', 'login', 'purchase', 'click'],)
Expected Output: 'logout'
Input: (['a', 'b', 'a', 'b'],)
Expected Output: None
Input: ([],)
Expected Output: None
Input: (['same', 'unique', 'same', 'later'],)
Expected Output: 'unique'
Hints
- Count frequencies first, then scan in original order.