← Microsoft questions

Diagonal matrix traversal as an iterator class

Filed under Microsoft

Design an iterator class DiagonalIterator over a 2D matrix that returns the elements one at a time in diagonal order. Implement: - DiagonalIterator(matrix): initialises the iterator with a matrix of m…

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 Microsoft questions

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