Memory region overlap detection in a base-and-bounds OS
This easy C++ coding problem tests your ability to implement a core operating-system abstraction: detecting whether processes have violated memory isolation in a base-and-bounds memory management scheme. You must build a data structure that stores process regions and efficiently identifies all overlapping pairs.
The key challenges are understanding the precise overlap condition (adjacent regions do not overlap), handling edge cases like zero-bounds processes, and avoiding integer overflow when computing region boundaries. A straightforward O(n²) pairwise comparison is acceptable given the 10,000-process constraint; the focus is on correctness and clean logic rather than advanced data structures.
- Half-open interval semantics and boundary conditions
- Unsigned integer arithmetic and overflow safety
- Exhaustive pair enumeration with canonical ordering (pid_i < pid_j)