Check Fixed Board Placements Against Number-Line Blockers
Company: Capital One
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Online Assessment
You are given point blockers on an infinite number line and proposed boards, each with a fixed starting coordinate and length. Determine independently whether each board can be placed without covering a blocker.
Implement `can_place_boards(blockers: int[], boards: int[][]) -> bool[]`. Each board row is `[start, length]`. Return one Boolean per board in input order.
### Constraints & Assumptions
- For this deterministic practice version, a board occupies the half-open interval `[start, start + length)`. A blocker at the start prevents placement; one exactly at the end does not.
- The report's examples do not resolve endpoint contact. The half-open convention is an explicit practice assumption.
- Lengths are positive integers at most 1,000,000,000. Blocker coordinates and board starts range from -1,000,000,000 through 1,000,000,000.
- There are at most 200,000 blockers and 200,000 boards. Blockers may be unsorted or repeated.
- All blockers are fixed before the checks. A successful check does not place a permanent board or affect later checks.
- The board must start at the specified coordinate. Do not search for a different location or a free subinterval within a larger prefix.
### Examples
```text
blockers = [3,7,11]
boards = [[0,2],[5,3]]
result = [true,false]
```
The second board covers coordinate 7.
```text
blockers = [3]
boards = [[1,2],[3,1],[4,1]]
result = [true,false,true]
```
The first board ends exactly at 3 and does not include that coordinate under the chosen convention.
```hint Find the nearest relevant blocker
For a board starting at a fixed coordinate, blockers to its left cannot matter. Consider the first blocker at or to the right of that start.
```
Overview: Check fixed board intervals against sorted number-line blockers, with explicit endpoint rules, duplicate blockers, and independent placement queries.
Read the full Capital One Software Engineer interview experience this question came from
You are given point blockers on an infinite number line and proposed boards, each with a fixed starting coordinate and length. Determine independently whether each board can be placed without covering a blocker.
Implement `can_place_boards(blockers: int[], boards: int[][]) -> bool[]`. Each board row is `[start, length]`. Return one Boolean per board in input order.
### Constraints & Assumptions
- For this deterministic practice version, a board occupies the half-open interval `[start, start + length)`. A blocker at the start prevents placement; one exactly at the end does not.
- The report's examples do not resolve endpoint contact. The half-open convention is an explicit practice assumption.
- Lengths are positive integers at most 1,000,000,000. Blocker coordinates and board starts range from -1,000,000,000 through 1,000,000,000.
- There are at most 200,000 blockers and 200,000 boards. Blockers may be unsorted or repeated.
- All blockers are fixed before the checks. A successful check does not place a permanent board or affect later checks.
- The board must start at the specified coordinate. Do not search for a different location or a free subinterval within a larger prefix.
### Examples
```text
blockers = [3,7,11]
boards = [[0,2],[5,3]]
result = [true,false]
```
The second board covers coordinate 7.
```text
blockers = [3]
boards = [[1,2],[3,1],[4,1]]
result = [true,false,true]
```
The first board ends exactly at 3 and does not include that coordinate under the chosen convention.
```hint Find the nearest relevant blocker
For a board starting at a fixed coordinate, blockers to its left cannot matter. Consider the first blocker at or to the right of that start.
```
Constraints
- At most 200000 blocker coordinates and 200000 board rows; blockers may be unsorted or repeated.
- Coordinates and board starts range from -1000000000 through 1000000000; lengths are positive and at most 1000000000.
- Each board occupies [start,start+length): a blocker at start prevents placement, one at the end does not.
- Checks are independent against fixed blockers. Do not move the specified start or persist successful placements.
- Return one boolean per board in input order.
Examples
Input: ([3, 7, 11], [[0, 2], [5, 3]])
Expected Output: [True, False]
Explanation: A blocker strictly inside the second interval prevents placement.
Input: ([3], [[1, 2], [3, 1], [4, 1]])
Expected Output: [True, False, True]
Explanation: The end is excluded but the start is included.