FastPrepFour-by-Four Boundary Grid
Problems/Four-by-Four Boundary Grid

Four-by-Four Boundary Grid

Susquehanna International Group (SIG) logoSusquehanna International Group (SIG)● MediumFULLTIMEINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a SIG online assessment. The brief report describes filling a four-by-four grid with boundary conditions but leaves out their exact rules. We define the visibility clues and a fixed way to write the result. Our version is about 35% the same as the reported question.

Fill a 4 x 4 grid with values from 1 through 4. For this exercise, assume every row and every column contains each value exactly once. There are no additional 2 x 2 box constraints.

The values represent heights. Looking along a row or column from an edge, a height is visible only when it is larger than every height before it.

You receive a 4 x 4 matrix clues:

  • clues[0][c] is the number visible in column c from the top.
  • clues[1][r] is the number visible in row r from the right.
  • clues[2][c] is the number visible in column c from the bottom.
  • clues[3][r] is the number visible in row r from the left.
  • A clue of 0 adds no requirement. Row indices always run from top to bottom; column indices always run from left to right, including bottom and right clues.

Return the lexicographically smallest valid grid. Compare the values from left to right across the first row, then the second row, and so on; at the first difference, the smaller value wins. If no grid satisfies every nonzero clue, return an empty matrix [].

Function

solveBoundaryGrid(clues: int[][]) → int[][]

Examples

Example 1

clues = [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]return = [[1,2,3,4],[2,1,4,3],[3,4,1,2],[4,3,2,1]]

No boundary imposes a condition. The lexicographically first Latin grid is selected; no 2 x 2 box rule is applied.

Example 2

clues = [[2,2,3,1],[1,3,3,2],[3,2,1,2],[3,1,2,3]]return = [[2,3,1,4],[4,1,3,2],[3,4,2,1],[1,2,4,3]]

All four sides constrain the grid. Each boundary entry is checked from its stated viewing direction.

Example 3

clues = [[1,1,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]return = []

Both first two columns would have to begin with 4, which repeats 4 in the first row, so no grid exists.

Constraints

  • clues.length = 4 and every row of clues has length 4.
  • 0 <= clues[s][i] <= 4.
  • Clues may be incomplete or inconsistent.

More Susquehanna International Group (SIG) Online Assessment questions

  • Centered Block Placement QueriesOA · Seen Dec 2026
  • Catch Fish with Reusable BaitsOA · Seen Nov 2026
  • Bold Play to Reach a GoalOA · Seen Nov 2026
  • Cats, Truth and Who Has MoreOA · Seen Nov 2026
  • Counting Cows by Their LegsOA · Seen Nov 2026
  • Enough Muffins for the LineOA · Seen Nov 2026
  • Expected Consecutive Pairs Among Chosen NumbersOA · Seen Nov 2026
  • Frog Paths Without Long RunsOA · Seen Nov 2026
  • Higher Roll, or Lose the SumOA · Seen Nov 2026
  • Is a Popular Story Fake?OA · Seen Nov 2026

Similar questions at other companies

  • Word SearchBloomberg LP · OA · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Rat in a Maze: All Simple PathsPeopleStrong · OAPeopleStrong interview questions
  • Find a Word Path Moving Right or DownIntuit · OAIntuit interview questions
  • Empty ShelfSquarepoint Capital · OASquarepoint Capital interview questions
  • Cave AdvantureMeta · OAMeta interview questions
  • Optimal Office PlacementRoblox · OARoblox interview questions
  • Complete a Sudoku BoardJP Morgan Chase · OAJP Morgan Chase interview questions
  • Word SearchAmazon · ONSITE INTERVIEW
  • Word SearchMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Enumerate Character Paths to a MarkerTesla · ONSITE INTERVIEWTesla interview questions

Interview reports that mention this question

  • SIG Quant Research Intern Interviews: 60 Experiences

Susquehanna International Group (SIG) interview experiences

  • SIG Quant Researcher Experienced Hire Interviews: 11 Experiences
  • SIG Quant Researcher New Grad Interviews: 49 Experiences
  • SIG Quant Researcher Intern Interviews: 1 Experience
  • SIG Quant Second-Round Tech Screen: 1 Experience
All Susquehanna International Group (SIG) interview questionsSee Susquehanna International Group (SIG) hiring insights
Saved
class Solution {
    public int[][] solveBoundaryGrid(int[][] clues) {
        // write your code here
    }
}
Checking account…