← BlackRock Interview Insights

BlackRock·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Technical screen for a data engineer role at BlackRock, two interval problems back to back. First one was more conceptual, second one they actually wanted working code, which I wasn't fully expecting.

Questions Asked (2)

Q1

Given an unsorted array of integer intervals, merge all overlapping ones and return the result.

Algorithms & Data Structures
Author's notes

They said I didn't need to write full code, just explain the algorithm clearly.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem: intervals are inclusive, input may be unsorted, and output should be merged. Then propose sorting by start time and iterating to merge overlapping intervals, analyzing time and space complexity.

Pro tip: Mention edge cases like empty input, single interval, and intervals that only touch at endpoints (e.g., [1,2] and [2,3] may or may not merge depending on definition). Also, discuss whether the input can be modified and if stability matters.

1. Clarify requirements and edge cases

Ask about interval inclusivity, whether input can be modified, and expected output format. Confirm handling of empty input, single interval, and touching intervals.

2. Choose an efficient algorithm

Sort intervals by start time, then iterate and merge if the current interval overlaps with the last merged interval. This yields O(n log n) time due to sorting.

3. Implement and test with examples

Write clean code, using a result list. Test with provided examples and edge cases like [[1,4],[4,5]] to verify merge condition.

4. Analyze complexity and trade-offs

State time complexity O(n log n) and space complexity O(n) for the output (or O(1) extra if sorting in-place and output not counted). Discuss if a linear-time solution is possible with assumptions.

Key Points to Mention

  • Sorting by start time is key to simplifying the merging process.
  • Merge condition: if current interval's start <= last merged interval's end, they overlap.
  • Time complexity: O(n log n) due to sorting; space complexity: O(n) for output.
  • Edge cases: empty array, single interval, intervals that touch at endpoints.
  • In-place sorting can reduce extra space if input modification is allowed.
  • Clarify whether intervals are closed [a,b] or half-open; this affects merging of touching intervals.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

You have a sorted list of non-overlapping intervals. Insert a new interval and return the merged result with no overlaps.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This is where it got real, they wanted actual code or tight pseudocode, not just hand-waving.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the problem constraints and edge cases, then propose a linear scan approach that inserts the new interval in the correct position and merges overlapping intervals. Walk through the algorithm step-by-step, analyze time and space complexity, and discuss potential optimizations or trade-offs.

Pro tip: Mention that since the intervals are sorted and non-overlapping, we can solve this in O(n) time by scanning once, which is optimal. Also, highlight that this approach is efficient for large datasets and can be easily adapted for streaming scenarios.

1. Clarify and Validate

Ask clarifying questions about input format, interval inclusivity, and expected output. Confirm that intervals are sorted and non-overlapping.

2. Outline the Algorithm

Describe a three-phase approach: add all intervals ending before the new interval starts, merge overlapping intervals with the new interval, then add the remaining intervals.

3. Walk Through an Example

Trace the algorithm on a sample input to demonstrate correctness and edge cases, such as inserting at the beginning, end, or merging multiple intervals.

4. Analyze Complexity

State that the time complexity is O(n) and space complexity is O(n) for the output, which is optimal since we must examine each interval at least once.

5. Discuss Trade-offs and Extensions

Mention alternative approaches like binary search for insertion point (still O(n) due to merging) and discuss how to handle unsorted intervals or streaming data.

Key Points to Mention

  • Sorted and non-overlapping property allows linear scan
  • Three-phase approach: before, merge, after
  • Edge cases: new interval before all, after all, overlapping multiple
  • Time complexity O(n), space complexity O(n)
  • In-place merging possible if modifying input is allowed
  • Binary search for insertion point doesn't improve overall complexity

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.