FastPrepCompletely Passable Grid Rows and Columns
Problems/Completely Passable Grid Rows and Columns

Completely Passable Grid Rows and Columns

Walmart logoWalmart● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The goal of finding all-zero rows and columns matches the named firsthand report at about 95%, including the clarification from the same author. String rows as input, zero-based ordered indices, the result format and finite limits are our assumptions. We wrote all the complete examples.

A rectangular board contains 0 for a passable cell and + for an obstacle. Return the rows and columns that are completely passable: every cell in each returned row or column must be 0.

For this exercise, assume grid contains one string per row. Return exactly two integer arrays: first the row indices, then the column indices. Indices are zero-based and each array is in increasing order. Either array may be empty.

Function

passableLines(grid: String[]) → int[][]

Examples

Example 1

grid = ["000","+00","000"]return = [[0,2],[1,2]]
grid
01200001+002000
→
return
01002112

Rows 0 and 2 and columns 1 and 2 contain only zeroes.

Example 2

grid = ["0+","+0"]return = [[],[]]
grid
0100+1+0

Every row and column contains an obstacle.

Example 3

grid = ["0"]return = [[0],[0]]
grid
000
→
return
00010

The single passable cell makes both its row and column completely passable.

Constraints

  • For this exercise, assume 1 <= grid.length <= 30 and each row has the same length from 1 through 30.
  • Every cell is 0 or +.

More Walmart Phone Screen questions

  • Count Months Starting on SundayPHONE SCREEN · Seen Aug 2026
  • Longest Even-Length WordPHONE SCREEN · Seen Aug 2026
  • Range ModulePHONE SCREEN · Seen Aug 2026
  • Meeting Rooms IIPHONE SCREEN · Seen Aug 2026
  • Sort Real Number StringsPHONE SCREEN · Seen Jan 2026
  • Check a Password Against a Supplied PolicyPHONE SCREEN · Seen Jun 2025
  • Convert a Restricted Function to an Arrow FunctionPHONE SCREEN · Seen Jun 2025
  • Repair One Missing Function Punctuation CharacterPHONE SCREEN · Seen Jun 2025
  • Can the Singer Perform the Song?PHONE SCREEN · Seen Mar 2025
  • Rooms With Two Other Entrances and a Treasure SuccessorPHONE SCREEN · Seen Mar 2025

Similar questions at other companies

  • Validate a Chess Bishop, Rook, or Queen MoveGlean · PHONE SCREENGlean interview questions
  • One-Nearest-Neighbor Classification with Manhattan DistanceOpenAI · PHONE SCREENOpenAI interview questions
  • Unique Pairs in a 2D Matrix Summing to TargetAmazon · PHONE SCREEN
  • Map Black Cells to Covering 2x2 BlocksSquare · PHONE SCREEN
  • Trace an Eight-Direction Robot Until BlockedPinterest · PHONE SCREENPinterest interview questions
  • Excel Training Data and Model Response AuditMicrosoft · PHONE SCREENMicrosoft interview questions
  • Count Connect-Four Scoring LinesBloomberg LP · PHONE SCREENBloomberg LP interview questions
  • Target Cells in One Block per Row and ColumnWhatNot · PHONE SCREENWhatNot interview questions
  • Completely Passable Grid LinesSplunk · PHONE SCREENSplunk interview questions
  • Mark a Queen’s Attack BoardMotive · PHONE SCREENMotive interview questions
All Walmart interview questionsSee Walmart hiring insights
Saved
class Solution {
    public int[][] passableLines(String[] grid) {
        // Write your code here.
        return new int[][]{new int[0],new int[0]};
    }
}
Checking account…