PracHub
QuestionsCoachesLearningGuidesInterview Prep

Quick Overview

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.

  • Medium
  • BlackRock
  • Coding & Algorithms
  • Software Engineer

Implement sorting and set intersection with input parsing

Company: BlackRock

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

Write two functions and explain your approach in under two minutes after coding: (A) Sorting: Implement sort_numbers(nums: List[int]) -> List[int] that returns nums in non-decreasing order without using built-in sort; use a standard algorithm and describe time/space complexity and stability. (B) Set Intersection: Implement intersect_sets(a: Iterable[int], b: Iterable[int]) -> List[int] that returns the unique elements present in both a and b in ascending order; describe time/space complexity and key edge cases (e.g., empty inputs, duplicates). Assume you must handle input parsing yourself (no helpers), and you will have two fixed test cases with a single allowed submission.

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

Return the numbers in non-decreasing order using merge 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

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

Sorted Set Intersection

Return unique elements present in both inputs in ascending order.

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

  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
  • AI Coding 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

  • Solve two interval array problems - BlackRock (medium)
  • Traverse a tree and answer 2D prefix sums - BlackRock (easy)
  • Design paint editor with undo/redo - BlackRock (easy)
  • Solve hierarchy distance and digit-square convergence - BlackRock (Medium)