InterviewLegend

Grids and Matrices

Alex Chen35 min readUpdated

Grid problems come up across Chewy's loops, from senior phone screens and first technical rounds to a senior front-end loop. Some carry a warehouse story on top, and a first round on HackerRank also built its problem on 2D arrays.

Two of the problems share one skeleton. From a cell, visit the four straight neighbors that sit inside the grid and haven't been seen yet. What changes is where the walk starts and what you record as it spreads.

The third works differently. There's no search at all, only index arithmetic on a square. In all of these, the edges of the grid are where code breaks, so trace a 3x3 example with something on a corner before you run anything.

ChewyPremium lesson · Coding round

The 3 Chewy problems are below.

  1. A Premium questionCoding · Medium
  2. A Premium questionCoding · Medium
  3. A Premium questionCoding · Medium

Each with hints, the follow-up and a tested solution.

Get the Chewy questions

$49 a year · all 100 companies · cancel anytime

From 20,000+ candidate reports, forum threads behind logins and write-ups in Chinese.

Had your Chewy interview?Tell us what they asked. Reviewed before it goes in, never with your name.
Chewy interview guide

Know what Chewy asks before you walk in.

30 coding · 1 system design · 28 behavioral questions

Get Premium$49 a year · Cancel anytime
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.