← Goldman Sachs questions

Zig-Zag Matrix

Filed under Goldman Sachs · Also reported at FactSet

Given an M x N matrix, return all elements of the matrix in a diagonal zig-zag order. The traversal starts at the top-left element (0,0) and moves in a diagonal fashion, alternating direction between…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Goldman Sachs questions

Collected from public candidate posts and coding forums. Updated Nov 2026.