Solve Python Challenges: Reverse String, Palindrome, Fibonacci, Unique List
Company: OneMain Financial
Role: Data Scientist
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Onsite
Overview: This question evaluates fundamental programming skills such as string manipulation, algorithmic reasoning for numeric patterns, sequence generation, and data deduplication within the Coding & Algorithms domain for a Data Scientist role.
Constraints
- 0 <= len(nums) <= 200000
- -1000000000 <= nums[i] <= 1000000000
- Preserve the order of first occurrences
- Do not sort the input
- Target time complexity: O(n)
- Target space complexity: O(n)
- Do not import external libraries
Hints
- Use a hash set to track which values have been seen.
- Append a number to the result only the first time it appears.
- Avoid sorting; membership checks in a set are O(1) on average.