Open In App

Paytm Interview Experience | Set 9

The tough question for me and the reason I couldn’t get selected (I think that’s the reason) Given an array with numbers in it, you will have n number of queries, each query will have 3 inputs x, y, val where x and y represents the start and end indices of a subarray whose all elements must be increased by a value ‘val’ and then there would be n queries again where each query will have x and y where each query must be returned with the sum of the subarray [x index to y index] of the updated array. At first glance, everyone would say that just add every
time a query has been sent but then there would be no point of asking. So, I said I would use union and intersection of the indices and somehow get to the answer and so he asked how to find union and intersection and that’s where I toppled and couldn’t answer and that’s it they said ok and I left.



After an hour, the results came and they didn’t select anyone from IT profile 🙁

Article Tags :