Zensar Technologies OA | Find Pairs With Given Sum & Sort Array of 0s 1s and 2s

Question · Posted Jun 2026

Problem 1 - Inventory Logistics Matchmaker Problem Statement You are working on a batch-processing optimization engine for an enterprise logistics warehouse. The system receives an integer array inventoryWeights of size N and an integer targetCapacity. Your task is to calculate the total number of unique index pairs (i, j) such that: i < j and inventoryWeights[i] + inventoryWeights[j] = targetCapacity Return the total number of valid matching pairs. Constraints Constraint 1 ≤ N ≤ 105 -104 ≤ inventoryWeights[i] ≤ 104 ...

The full answer & interview discussion are available to premium members.

Log in Create a free account