FastPrepInterleave Array Halves
Problems/Interleave Array Halves

Interleave Array Halves

Autodesk logoAutodesk● EasyINTERNOA

Updated Oct 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The positional rearrangement matches the reported task. Even length, zero-based indices, bounds and examples are practice assumptions. Approximate source match: 85%.

You are given an integer array nums. Rearrange it so that its first half occupies the even-indexed positions and its second half, in reverse order, occupies the odd-indexed positions.

For this exercise, assume the array length is even and indices start at 0. Preserve the order of the first half and every occurrence of a duplicate value. Return the complete rearranged array without changing nums.

Function

interleaveHalves(nums: int[]) → int[]

Examples

Example 1

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

The first half [1,2,3] goes to indices 0, 2, and 4. The reversed second half [6,5,4] fills indices 1, 3, and 5.

Example 2

nums = [2,2,-3,9]return = [2,9,2,-3]

The two occurrences of 2 stay in their first-half order. The reversed second half is [9,-3].

Constraints

  • 2 <= nums.length <= 10^5
  • -10^9 <= nums[i] <= 10^9
  • The array length is even.

More Autodesk interview questions

  • Diagonal Bounce TraversalOA · Seen Oct 2026
  • Latest Arrival to Catch a BusOA · Seen Oct 2026
  • Find Top Two TeamsOA · Seen Sep 2026
  • In-Memory Database with TTLOA · Seen Mar 2026
  • LRU Cache with TTLONSITE INTERVIEW · Seen Oct 2026
  • Deep Merge with a Conflict ResolverONSITE INTERVIEW · Seen Mar 2026

Similar questions at other companies

  • Catch Fish with Reusable BaitsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Minimum Index Distance Between Person and CakeSnowflake · OA · PHONE SCREENSnowflake interview questions
  • Meandering ArrayVerisk · OA
  • Collect Branches for a Bird NestVisa · OAVisa interview questions
  • Maximum Requests in a Time WindowIBM · OAIBM interview questions
  • Set IntersectionBlackRock · OABlackRock interview questions
  • Can Every Package Fit in a BoxIMC Trading · OAIMC Trading interview questions
  • Filter Odds and Reverse EvensUpstart · OAUpstart interview questions
  • Score Difference When Even Picks Reverse the ListMicrosoft · OAMicrosoft interview questions
  • Maximum Events in a 60-Second WindowMarshall Wace · OAMarshall Wace interview questions

Interview reports that mention this question

  • Autodesk SDE Intern OA and Interviews: 5 Experiences
All Autodesk interview questionsSee Autodesk hiring insights
Saved
class Solution {
    public int[] interleaveHalves(int[] nums) {
        // write your code here
    }
}
Checking account…