Intervals Collision Detection Algorithm
As pointed out by the other answer, producing a list of the intersections is not doable in subquadratic time.
However, counting all the intersections can be done in linear time.
The rough idea for that one is to sort all coordinates (starting points and end points of intervals) into one list using counting sort (as the range of the values we are sorting is fixed) and iterate over it, maintaining a counter for the number of intervals intersecting at the current point and another one for the total number of intersections.
If the current coordinate is an end point, reduce the first counter by 1.
Otherwise (i.e. the current coordinate is a starting point), increase the first counter by 1 and increase the total counter by the value of the first counter.