Store a set of 2d segments S in some data structure. For an arbitrary query 2d segment q, answer a yes/no question in sublinear time: whether q intersect with any segment in S?
If the query is a vertical or horizontal segment, it can be solved by 2D segment tree in O(logn).The preprocessing is to sort the x-coordinates or y-coordinates of end points. But how about an arbitrary segment query?