← Microsoft questions

Array Rotation

Filed under Microsoft · Also reported at Arcesium, Aristocrat Gaming, Barclays, Cvent, Decimal Point Analytics, Grofers, IBM, MAQ Software and 1 more

Given an array `nums` of $n$ elements, rotate the array to the right by `k` steps in-place with $O(1)$ extra memory. For example, with $n = 7$ and $k = 3$, the array `[1, 2, 3, 4, 5, 6, 7]` is rotated…

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.