Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Leetcode 54. Spiral Matrix
Traverse the m×n matrix in clockwise spiral order (right, down, left, up) and return the elements in that sequence. The core challenge is managing changing boundaries or directions (layer-by-layer traversal) so each element is visited exactly once.
Asked at:
Microsoft
liveramp
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Late October, 2025
Microsoft
Mid-level
Early October, 2025
Meta
Staff
Traverse a matrix in the spiral order starting from (0, 0). How can it be modified if we need to traverse it from any arbitrary cell?
Early September, 2025
liveramp
Senior
Given a input number, print hashes in a way it goes spiral way
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.