Merge two sorted lists
Company: Two Sigma
Role: Data Scientist
Category: Coding & Algorithms
Difficulty: easy
Interview Round: Technical Screen
Quick Answer: This question evaluates a candidate's competency in array manipulation and merging algorithms, emphasizing understanding of ordered data and time complexity. Commonly asked in Coding & Algorithms interviews for Data Scientist roles, it assesses practical application-level skills in implementing efficient (linear-time) merges and algorithmic efficiency awareness.
Constraints
- Inputs are sorted non-decreasing
Examples
Input: ([1, 3, 5], [1, 2, 6])
Expected Output: [1, 1, 2, 3, 5, 6]
Input: ([], [1])
Expected Output: [1]
Input: ([2], [])
Expected Output: [2]
Hints
- Use two pointers.