PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep

Quick Overview

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.

  • medium
  • Microsoft
  • Coding & Algorithms
  • Software Engineer

Solve Three Coding Interview Problems

Company: Microsoft

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

The coding round contained three independent problems: 1. **Merge two sorted arrays and remove duplicates.** Given two sorted integer arrays `a` and `b`, return one sorted array that contains each distinct value appearing in either array exactly once. 2. **Find the vertex of a quadratic function within a range.** You can evaluate a quadratic function `f(x)` on integer inputs, and you are given an integer range `[L, R]` that is guaranteed to contain the vertex of the parabola. Find the integer `x` where the function reaches its extremum within that range. 3. **Design and implement a simplified search autocomplete system.** Build a data structure initialized with a collection of strings. It should support inserting a new string and querying a prefix to return all stored strings that begin with that prefix. Unlike a production autocomplete system, you do not need frequency-based ranking or top-`k` truncation.

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

Return one sorted array containing every distinct value from two sorted input arrays.

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

  1. Choose a representation that makes the core operation simple.
  2. Handle empty and boundary inputs before the main algorithm.

Quadratic Extremum in an Integer Range

Given coefficients a, b, c and an integer range, return the integer x where ax^2+bx+c reaches its extremum in the range plus the value.

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

  1. Choose a representation that makes the core operation simple.
  2. Handle empty and boundary inputs before the main algorithm.

Simplified Search Autocomplete

Maintain a set of strings and return sorted matches for prefix queries after optional insertions.

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

  1. Choose a representation that makes the core operation simple.
  2. Handle empty and boundary inputs before the main algorithm.
Last updated: Jun 27, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Return Top K Open Businesses - Microsoft (hard)
  • Implement Memory Allocation and In-Memory Records - Microsoft (medium)
  • Sort Three Categories In Place - Microsoft (medium)
  • Implement K-Means and Detect Divisible Subarrays - Microsoft (medium)
  • Retain Top K Elements - Microsoft (medium)