The "Check if Grid can be Cut into Sections interview question" is a geometric interval problem. You are given a grid and a list of rectangular boxes placed within it. You need to determine if the grid can be cut into three sections using either two horizontal lines or two vertical lines such that no line passes through any of the boxes.
Amazon and Bloomberg ask the "Check if Grid can be Cut into Sections coding problem" to evaluate a candidate's ability to simplify 2D geometry into 1D interval problems. It tests "Sorting interview pattern" skills and the ability to find "gaps" in overlapping intervals.
This problem is solved using the Interval Merging pattern.
Grid with 3 boxes: Box A at , Box B at , Box C at .
Whenever you see a problem with "rectangles" and "lines crossing the whole grid," immediately try to project the rectangles onto the X and Y axes. Turning a 2D problem into two independent 1D "Interval interview pattern" problems is a powerful problem-solving technique.
| Title | Difficulty | Topics | LeetCode |
|---|---|---|---|
| Sort the Jumbled Numbers | Medium | Solve | |
| Count Days Without Meetings | Medium | Solve | |
| Maximum Consecutive Floors Without Special Floors | Medium | Solve | |
| Remove Covered Intervals | Medium | Solve | |
| Merge Intervals | Medium | Solve |