Amazon interview question

Given two intervals, check if they intersect.