FastPrepRotate Array Right
Problems/Rotate Array Right

Rotate Array Right

Omnissa logoOmnissa● MediumONSITE INTERVIEW
QuestionFunctionExamples

Problem statement

A quick note: this problem is backed by a real Omnissa onsite interview report that directly named rotating an array right by k steps. The report did not include an exact function interface, examples, constraints, or behavior for large k. The core task match is about 95%.

You are given an integer array nums and an integer k. Rotate the array to the right by k steps and return the rotated array.

Interview Follow-up

This was part of a rapid-fire three-problem round in which the candidate presented brute-force, improved, and optimal approaches and wrote working code for each problem.

Function

rotateRight(nums: int[], k: int) → int[]

Examples

Example 1

nums = [1,2,3,4,5,6,7]k = 3return = [5,6,7,1,2,3,4]

Moving the last three values to the front gives [5,6,7,1,2,3,4].

Example 2

nums = [-1,-100,3,99]k = 2return = [3,99,-1,-100]

After two right rotations, 3 and 99 move to the front.

More Omnissa problems

  • Build and Check a Palindrome Linked ListONSITE INTERVIEW · Seen Sep 2026
  • Find the CelebrityONSITE INTERVIEW · Seen Sep 2026
  • Maximum All-Ones Square Side LengthONSITE INTERVIEW · Seen Sep 2026
All Omnissa interview questionsSee Omnissa hiring insights
Saved
public int[] rotateRight(int[] nums, int k) {
  // write your code here
}
Checking account…