0 day streak
Anonymous · shared experience20 Jul 2026 · 7 views

Zoho: Sort odds ascending and evens descending in place, keeping parity slots

Interview question #Zoho SDE 1 Online assessment

Problem. Given an integer array, sort the odd values in ascending order and the even values in descending order without using extra space. Each position keeps its parity: a slot that held an odd number still holds an odd number afterwards, and the same for even.

Example. Input 9 4 3 8 7 2 5 becomes 3 8 5 4 7 2 9.

Context. This was a mandatory gate in a three-hour campus programming round. Candidates had to solve it before the other questions unlocked, and anyone who couldn't was asked to leave. The questions after it were maximum circular subarray sum, regex matching with + and *, rearranging a string while keeping first-occurrence order, comparing version strings, and a peak-valley rearrangement where neighbours must differ by at least k.

What mattered. The no-extra-space rule was the main stated constraint. The next day's round was a UML-first employee-database design with seven implementation tasks, where explaining the implementation counted heavily.

0 comments

Comments 0

No comments yet. Ask the author something, or add what happened in your own round.