Solve Three Coding Interview Problems
Company: Microsoft
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
Quick Answer: This set of problems evaluates competency in algorithmic problem-solving, including merging sorted arrays with duplicate elimination, reasoning about the extremum of a quadratic function within integer bounds, and the design and implementation of prefix-based string search, and falls within the Coding & Algorithms category.
Merge Two Sorted Arrays Without Duplicates
Constraints
- Inputs are provided as Python literals matching the function signature.
- Return a deterministic exact-match result.
Examples
Input: ([1,2,2,4], [2,3,4,5])
Expected Output: [1, 2, 3, 4, 5]
Explanation: Duplicates across arrays.
Input: ([], [1,1,2])
Expected Output: [1, 2]
Explanation: One array empty.
Input: ([-3,-1], [-2,-1])
Expected Output: [-3, -2, -1]
Explanation: Negative values.
Hints
- Choose a representation that makes the core operation simple.
- Handle empty and boundary inputs before the main algorithm.
Quadratic Extremum in an Integer Range
Constraints
- Inputs are provided as Python literals matching the function signature.
- Return a deterministic exact-match result.
Examples
Input: (1, -4, 1, 0, 5)
Expected Output: {'x': 2, 'value': -3}
Explanation: Minimum near vertex x=2.
Input: (-1, 6, 0, 0, 10)
Expected Output: {'x': 3, 'value': 9}
Explanation: Maximum near vertex x=3.
Input: (2, 0, 0, 5, 7)
Expected Output: {'x': 5, 'value': 50}
Explanation: Vertex outside range, use boundary.
Hints
- Choose a representation that makes the core operation simple.
- Handle empty and boundary inputs before the main algorithm.
Simplified Search Autocomplete
Constraints
- Inputs are provided as Python literals matching the function signature.
- Return a deterministic exact-match result.
Examples
Input: (['app','apple','bat'], [['query','app'], ['insert','application'], ['query','app'], ['query','b']])
Expected Output: [['app', 'apple'], None, ['app', 'apple', 'application'], ['bat']]
Explanation: Insert affects later queries.
Input: ([], [['query','a'], ['insert','a'], ['query','a']])
Expected Output: [[], None, ['a']]
Explanation: Empty initial set.
Hints
- Choose a representation that makes the core operation simple.
- Handle empty and boundary inputs before the main algorithm.