Paytm Associate Developer Interview Question 2022 April | Arrays | on-campus

Paytm · Question · Posted Jun 2026

Question 1: Maximum Subarray Problem Statement Given an integer array nums, find the subarray with the largest sum, and return its sum. A subarray is a contiguous non-empty sequence of elements within an array. Constraints 1 <= nums.length <= 105 -104 <= nums[i] <= 104 Examples Example 1: Input: nums = [-2, 1, -3, 4, -1, 2, 1, -5, 4] Output: 6 Explanation 1: The subarray [4, -1, 2, 1] (indices 3 to 6) has the maximum sum of 6. ...

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

Log in Create a free account