Implement sorting and set intersection with input parsing
Company: BlackRock
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: Medium
Interview Round: Take-home Project
Quick Answer: This question evaluates proficiency in algorithm design and implementation, specifically sorting algorithms, set intersection logic, input parsing, and analysis of time/space complexity and algorithm stability within the Coding & Algorithms domain.
Sort Numbers Without Built-in Sort
Constraints
- Inputs are provided as Python literals matching the function signature.
- Return a deterministic exact-match result.
Examples
Input: ([3,1,2,1],)
Expected Output: [1, 1, 2, 3]
Explanation: Duplicates.
Input: ([],)
Expected Output: []
Explanation: Empty input.
Input: ([-1,5,0],)
Expected Output: [-1, 0, 5]
Explanation: Negatives.
Hints
- Choose a representation that makes the core operation simple.
- Handle empty and boundary inputs before the main algorithm.
Sorted Set Intersection
Constraints
- Inputs are provided as Python literals matching the function signature.
- Return a deterministic exact-match result.
Examples
Input: ([1,2,2,3], [2,2,4])
Expected Output: [2]
Explanation: Unique intersection.
Input: ([], [1])
Expected Output: []
Explanation: Empty input.
Input: ([-2,-1,0], [-1,0,1])
Expected Output: [-1, 0]
Explanation: Negatives.
Hints
- Choose a representation that makes the core operation simple.
- Handle empty and boundary inputs before the main algorithm.