← Questions

Sort a grid into snake order with adjacent swaps

0
UberCodingLast asked Sep 2026

A coding interview question asked in Uber's technical phone screen, last asked Sep 2026. It tests grids, simulation and sorting.

An n x n board holds each number from 1 to nn exactly once. Rearrange it into snake order: the first row increases left to right, the second row continues right to left, and the rows keep alternating.

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

  • Uber · Technical phone screen · Last asked Sep 202660 min · One medium problem with a follow-up, or two short ones; sometimes object-oriented design

What it tests

grids · simulation · sorting

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