← Questions

Copy a rectangle within a 2D array in place

0
WaymoCodingLast asked Sep 2026

A coding interview question asked in Waymo's coding round, last asked Sep 2026. It tests matrices, in-place and memory.

Given a 2D grid and a rectangular block inside it (height rows, width columns, top-left at (src_row, src_col)), copy the block so that its top-left lands at (dst_row, dst_col). Use O(1) extra memory: no temporary copy of the block, a row…

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Waymo · Coding · Last asked Sep 202645 min · Usually two rounds; some give you the interviewer's buggy code to find and fix, some are read aloud with no skeleton

What it tests

matrices · in-place · memory

Your code and the AI tutor open when you unlock this question.