Flipkart SDE Interview Question 2022 August | Segment Trees & Lazy Propagation | Off-campus
Flipkart · Question · Posted Jun 2026
Question 1: Range Update and Range Sum Query Problem Statement You are given an integer array nums of size N. You need to handle multiple queries of two specific types: Range Update: Add a value val to ALL elements in the inclusive range [left, right]. Range Sum: Calculate the exact sum of the elements in the inclusive range [left, right]. Implement the SegmentTree class with the functions updateRange(left, right, val) and querySum(left, right) to operate efficiently. Constraints 1 <= N ...
The full answer & interview discussion are available to premium members.
Log in Create a free account