MongoDB Hiring Question | Range Module | off campus OA 2024

Question · Posted Jun 2026

Problem Statement A Range Module is a module that tracks ranges of numbers. Design a data structure to track the ranges represented as half-open intervals and query about them. A half-open interval [left, right) denotes all the real numbers x where left <= x < right. Implement the RangeModule class: RangeModule(): Initializes the object of the data structure. void addRange(int left, int right): Adds the half-open interval [left, right), tracking every real number in that interval. Adding an interval that ...

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

Log in Create a free account