Sort a Matrix into Snake Order Using Adjacent Swaps

Read the full interview experience this question came from →

Quick Overview

Construct any legal adjacent-swap sequence that sorts a numbered matrix into snake order, prove correctness, validate the output, and discuss reducing swap counts.

Sort a Matrix into Snake Order Using Adjacent Swaps

Company: Uber

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Technical Screen

Overview: Construct any legal adjacent-swap sequence that sorts a numbered matrix into snake order, prove correctness, validate the output, and discuss reducing swap counts.

Read the full Uber Software Engineer interview experience this question came from

Uber logo
Uber
Sep 9, 2026
hardSoftware EngineerTechnical ScreenCoding & Algorithms
5
0
Loading...