FastPrepFill and Sort Packed Missing-Number Grids
Problems/Fill and Sort Packed Missing-Number Grids

Fill and Sort Packed Missing-Number Grids

ZipRecruiter logoZipRecruiter● MediumNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A ZipRecruiter new-grad OA report describes side-by-side 4 by 4 grids, values 1 through 16, one missing marker in each grid, filling it in, and sorting by the missing value. We supplied the packed layout of the returned result and limits. Our version is about 93% the same as the reported question.

packed has four rows and 4k columns. Every consecutive four-column block is one 4 by 4 logical grid containing the strings 1 through 16, except that exactly one value is replaced by ?.

Fill every missing value, sort the logical grids by that numeric value ascending, and return the grids packed side by side in the new order.

Function

fillAndSortGrids(packed: String[][]) → String[][]

Examples

Example 1

packed = [["1","2","3","4","?","2","3","4"],["5","6","7","8","5","6","7","8"],["9","10","11","12","9","10","11","12"],["13","14","15","?","13","14","15","16"]]return = [["1","2","3","4","1","2","3","4"],["5","6","7","8","5","6","7","8"],["9","10","11","12","9","10","11","12"],["13","14","15","16","13","14","15","16"]]

The filled grids are reordered by missing value.

Example 2

packed = [["1","2","3","4"],["5","6","?","8"],["9","10","11","12"],["13","14","15","16"]]return = [["1","2","3","4"],["5","6","7","8"],["9","10","11","12"],["13","14","15","16"]]

A single logical grid is filled without movement.

Constraints

  • 1 <= k <= 1000
  • packed.length == 4 and packed[r].length == 4k.

More ZipRecruiter Online Assessment questions

  • Four-Level Banking System with Scheduled PaymentsOA · Seen Oct 2026
  • Count Three-Digit Numbers with Distinct DigitsOA · Seen Oct 2024
  • Longest Frequency-Bounded SubarrayOA · Seen Oct 2024
  • Minimum Changes to Draw a YOA · Seen Oct 2024
  • Apply Binary State OperationsOA · Seen Sep 2024
  • Simulate Orchard Rot SpreadOA · Seen Sep 2024
  • Compare Odd- and Even-Index SumsOA · Seen Sep 2024
  • Coordinate Removals with Column GravityOA · Seen Sep 2024
  • Lexicographically Smallest End ReversalOA · Seen Sep 2024
  • Recursively Expanded Shell Command CountsOA · Seen Sep 2024

Similar questions at other companies

  • Bouncing Diagonal WeightsCapital One · OACapital One interview questions
  • Sort Concentric Matrix Borders ClockwiseByteDance · OAByteDance interview questions
  • Sort Concentric Matrix RingsxAI · OAxAI interview questions
  • Minimum Cost Path with TeleportationsAmazon · OA
  • Best Meeting PointWalmart · OAWalmart interview questions
  • Longest Increasing Path in a MatrixNutanix · OANutanix interview questions
  • Sparse Matrix Addition and MultiplicationPinterest · PHONE SCREENPinterest interview questions
  • Optimal Central WarehouseGoogle · ONSITE INTERVIEWGoogle interview questions
  • Enumerate Character Paths to a MarkerTesla · ONSITE INTERVIEWTesla interview questions
  • Map Black Cells to Covering 2x2 BlocksSquare · PHONE SCREEN

ZipRecruiter interview experiences

  • ZipRecruiter SWE OA, Level Not Reported: 23 Experiences
  • ZipRecruiter SWE Intern OA Scores: 4 Experiences
  • ZipRecruiter SWE New Grad OA: 9 Experiences
All ZipRecruiter interview questionsSee ZipRecruiter hiring insights
Saved
class Solution {
    public String[][] fillAndSortGrids(String[][] packed) {
        // Write your code here.
    }

}
Checking account…