← Microsoft questions

Arrange odd elements at odd indices and even elements at even indices

Filed under Microsoft

Given an array of integers, rearrange the elements such that every odd number appears at an odd index and every even number appears at an even index. You may assume that the number of odd and even…

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.