Mphasis OA | Rearrange Array by Sign & Longest Substring Without Repeating Characters
Question · Posted Jun 2026
Problem 1 - Retail Order Stock Balancer Problem Statement You are working on an inventory ledger for an e-commerce platform. The system records stock adjustments in an integer array stockDeltas of size N, where N is always even. The array contains an equal number of positive and negative integers. Your task is to rearrange the elements so that: The sequence starts with a positive number. Positive and negative numbers appear alternately. The relative order of positive numbers remains unchanged. The ...
The full answer & interview discussion are available to premium members.
Log in Create a free account