PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/BlackRock

Solve two interval array problems

Last updated: Apr 6, 2026

Quick Overview

This question evaluates proficiency with array and interval-manipulation concepts—specifically sorting, merging overlapping ranges, and robust edge-case handling in interval operations.

  • medium
  • BlackRock
  • Coding & Algorithms
  • Data Engineer

Solve two interval array problems

Company: BlackRock

Role: Data Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

You are given two interval-based tasks from a technical screen for a data engineering role. 1. **Merge overlapping intervals** - Input: an array of integer intervals `intervals`, where each interval is `[start, end]`. - The intervals may be unsorted. - Return a new array where all overlapping intervals are merged. - Example: `[[1,3],[2,6],[8,10],[15,18]]` becomes `[[1,6],[8,10],[15,18]]`. - In the interview, you only need to explain the algorithm clearly; full runnable code is not required. 2. **Insert and merge one interval** - Input: a list of non-overlapping intervals sorted by start time, plus one additional interval `new_interval`. - Insert `new_interval` into the list so that the final result is still sorted and contains no overlapping intervals. - Example: `intervals = [[1,2],[3,5],[6,7],[8,10],[12,16]]`, `new_interval = [4,8]` should return `[[1,2],[3,10],[12,16]]`. - For this task, write code or precise pseudocode that handles edge cases and passes test cases. Discuss the key edge cases, such as empty input, intervals that fully contain one another, and insertion at the beginning or end.

Quick Answer: This question evaluates proficiency with array and interval-manipulation concepts—specifically sorting, merging overlapping ranges, and robust edge-case handling in interval operations.

Related Interview Questions

  • Traverse a tree and answer 2D prefix sums - BlackRock (easy)
  • Design paint editor with undo/redo - BlackRock (easy)
  • Implement sorting and set intersection with input parsing - BlackRock (Medium)
  • Solve hierarchy distance and digit-square convergence - BlackRock (Medium)
BlackRock logo
BlackRock
Feb 18, 2026, 12:00 AM
Data Engineer
Technical Screen
Coding & Algorithms
2
0

You are given two interval-based tasks from a technical screen for a data engineering role.

  1. Merge overlapping intervals
    • Input: an array of integer intervals intervals , where each interval is [start, end] .
    • The intervals may be unsorted.
    • Return a new array where all overlapping intervals are merged.
    • Example: [[1,3],[2,6],[8,10],[15,18]] becomes [[1,6],[8,10],[15,18]] .
    • In the interview, you only need to explain the algorithm clearly; full runnable code is not required.
  2. Insert and merge one interval
    • Input: a list of non-overlapping intervals sorted by start time, plus one additional interval new_interval .
    • Insert new_interval into the list so that the final result is still sorted and contains no overlapping intervals.
    • Example: intervals = [[1,2],[3,5],[6,7],[8,10],[12,16]] , new_interval = [4,8] should return [[1,2],[3,10],[12,16]] .
    • For this task, write code or precise pseudocode that handles edge cases and passes test cases.

Discuss the key edge cases, such as empty input, intervals that fully contain one another, and insertion at the beginning or end.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More BlackRock•More Data Engineer•BlackRock Data Engineer•BlackRock Coding & Algorithms•Data Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ 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.