The Uber Infrastructure Backend process was relatively compact: one coding phone screen followed by a three-round virtual onsite covering coding, low-level distributed-system design, and a hiring manager interview.
Interview Details
Phone Screen — Moving Numbers with Adjacent Swaps
You are given an n x n matrix containing every integer from 1 through n². The goal is to rearrange the matrix into the required increasing zigzag order. The restriction is that values cannot be moved directly to arbitrary positions. Each operation may only swap two cells that are adjacent in one of the four cardinal directions. Return any valid sequence of swap operations that transforms the initial board into the required final arrangement.
An illustrative example:
Initial board:
1 2 3
6 4 5
7 8 9
Initial board:
1 2 3
6 4 5
7 8 9
If the target zigzag arrangement for these rows is:
1 2 3
6 5 4
7 8 9
1 2 3
6 5 4
7 8 9
then one valid operation is conceptually:
swap 4 and 5
The interview did not require finding the minimum number of swaps. The follow-up asked how the total number of swap operations could be reduced or the transformation made more efficient. No test cases were provided, so I also had to create and walk through my own tests.
**Onsite Round 1 —
Unlock Full Details
Create a free account to unlock this interview experience report.