</>OfferRetriever
DashboardDiscuss
NEW
Halloween SalePremium questions, over 30% offUnlock all premium questions for over 30% off
$10.42$7.08/mo

--

:

--

:

--

:

--

Get this deal
Back to Microsoft Questions

Evens Before Odds

Medium

You are given an integer array nums. Rearrange nums so that all even numbers appear before all odd numbers. The relative order of even or odd numbers among themselves does not matter.

Return the minimum number of swaps needed to achieve this arrangement. A single swap exchanges the values at any two distinct indices. If the array is already arranged with all evens before all odds, return 0. ...

Asked at:MicrosoftOracle

More Microsoft interview questions

All Microsoft interview questions
OfferRetriever

Master technical interviews with real questions from top companies. Build your confidence and career.

PRODUCT
PricingDashboardDiscussOfferRetriever vs LeetCodeCompare
LEGAL

© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.