Elastic SWE Interview Question 2024 July | Arrays | on-campus
Question · Posted Jun 2026
Question 1: Rotate Array Problem Statement Given an integer array nums, rotate the array to the right by k steps, where k is non-negative. You must solve this in-place with O(1) extra space. Constraints 1 <= nums.length <= 105 -231 <= nums[i] <= 231 - 1 0 <= k <= 105 Examples Example 1: Input: nums = [1, 2, 3, 4, 5, 6, 7], k = 3 Output: [5, 6, 7, 1, 2, 3, 4] Explanation 1: Rotating right by ...
The full answer & interview discussion are available to premium members.
Log in Create a free account