IBM Associate Software Engineer OA 2026 | Maximum Balanced Subarray & Detect Unstable Processes
IBM · Question · Posted Jun 2026
Problem 1 - Maximum Balanced Subarray Problem Statement You are given a binary array arr containing only 0s and 1s. Find the length of the longest contiguous subarray that satisfies both of the following conditions: The number of 0s and 1s are equal. For every prefix of the chosen subarray, the count of 1s is always greater than or equal to the count of 0s. Return the length of the longest such subarray. Constraints Constraint 1 ≤ N ≤ 100000 ...
The full answer & interview discussion are available to premium members.
Log in Create a free account