Microsoft | OA | Counting Combinations of 3 Non-Overlapping Intervals

Microsoft · Question · Posted Apr 2026

Problem 1: Non Overlapping Intervals Description Three new health care buildings are to be built in HackerLand. They will be built on land with plots numbered consecutively starting from 1. There are two integer arrays, starting and ending, each of size n, that represent n intervals where the ith interval is [starting[i],ending[i]]. Determine the number of ways three non-overlapping intervals can be selected from the n intervals. Notes An interval is defined as [l,r] where it contains every integer between ...

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

Log in Create a free account